hello everyone,
I have a question, what should I do if I need to send an email containing a button, click the button without opening any browser, and directly return the value I need?
I tried using the Reactive RestAPI as the URL for the link, but it still opened the browser.
I tried traditional email content, but the button can only be written in the Block, and after sending, the button cannot be seen in the email.
Hi @LeonKT
I think your Requriment is you have send a email for a person and when the person recived a email so that email body part have a button and when you click that button you don't want to go to your application or you direct want to update some value without go to your application???
If this reequriment is Correct that it is not possible to update any value or retun any value without intract with your app ui /broweser
Thanks
Md Mansur
Thank you for your reply,Mansur.The Requriment is exactly what you say it is,I tried a lot of things, but it was really hard to implement on the outsystems platform, and the requirement seemed unreasonable.
Hi @LeonKT ,
The reason why links or buttons opens up a browser is because email clients are not capable of posting or accessing webpages. It does not understand http. That's why it opens up a capable application to do the job, a web browser. Also, even if this is possible, having a button that does not do anything is probably going get them to click it multiple times, leading them to become very frustrated with the email.
I believe you may need to change your approach on this.
I am not sure why you need to return a value. But if you need to, it would be much better to just open up the browser and redirect the user to your application that will make them return the value you want, or something that can make them entertained or interact with it.
Regards,
Bryan
Thank you for your reply, Villalobos.If that is true, I may not be able to implement this feature, in fact, this button is limited to only one click.
@LeonKT
Unfortunately, due to the nature of how emails and web technologies work, the behavior you're aiming for (triggering an action without opening a browser or performing an HTTP request) is not directly possible, because email clients are designed with strict security restrictions. Let me explain why and offer some potential alternatives that might work for your use case.
Why It Doesn't Work
Email Client Limitations:
Button Behavior in Emails:
Reactive REST APIs in Emails:
Alternatives & Workarounds
Since you can't trigger an action from an email directly without opening a browser, here are some alternative approaches to achieve something similar:
1. One-Click Actions (via REST API or Redirect URL):
2. Server-Side Email Handling (Email-Based Action Confirmation)
If browser interaction isn't ideal, consider email-based workflows where the user replies to an email to trigger an action.
How it works:
3. Link Shortening Services for User Tracking (Optional)
If you're concerned about opening a browser but still want to track when a user clicks the link, you can use services like Bitly or OutSystems' built-in link generation to create shortened URLs. This can also help you log who clicked the button and when the action was triggered.
As other members stated it is not possible execute JavaScript as email client blocks the same.
If your requirement is to show some status as "image" dynamically when an email is opened then there is an option. Have an image in your email and set the image source as OutSystems REST end point and based on the input parameter you generate an PNG ( using imageToolbox forge component ) or SVG file and return. You also need to set the correct content-type (image/png or image/svg+xml) using AddHeader method.
SVG would be faster as you can create it without depending on any forge component but do check the compatibility of SVG rendering on email clients.
Note : Please be aware of the security implications as these are open to internet and there will not be any authentication.