Im trying to improve our current setup of templating HTML emails by leveraging the Outsystems screen builder.
I have the email setup already implemented, outside of Outsystems (using a separate environment to send emails, so body is passed across an api request)
Right now we write the html of the email manually, store it in a db & do some find/replace for placeholder data. The response of which forms the body of the email.
Is it possible to do this using a screen? So on click of a button, perform a get request of an Outsystems screen, pass in variables, have the html returned which I can pass straight through to the email? Would certainly make creating the layouts much easier if so.
have tried textprocessing component & CKEditor.Reactive, both of which do bits of what I'm after, but I haven't managed to link it all up yet.
Thanks,
Steve
Hello Steve
There are certain JS that helps to fetch HTML from Page like var htmlContent = new XMLSerializer().serializeToString(document); but this is not an accurate way to do as whatever I have searched yet says OutSystems Abstract some elements.
I have one suggestion for you to try to create the HTML Body itself in Service Studio using the Expression. You can use a expression with the property "escape content" set to "No". This will save the HTML as it is and you can pass this data to 3rd party to get it. Or if possible you have use file to save data and render the file as HTML in your Email Service. I see, Outlook has such option to upload file as HTML and it render the content on Body.
I tried a GET request on an anonymous screen & it didn't return much, so yes, figure Outsystems abstract certain elements dependent on call location (I'm sure for a very good reason too!).
When you say use an expression, do you mean include all the HTML in there too? How would I hold that in memory so as it is not visible to the end user?
Thanks, for your help
Hi Steve
Considering the scenario of Abstraction and Dynamic Email Inputs - Sending emails from Outsystems itself with Service Studio will be the better approach in my opinion. When you are using the 3rd party tool you can use its SMTP Details to configure email in OS that will help to send email from your authorized email partner. Refer this to send the email
Through Expression I was saying that you can create a block with Expression widget where you can put your HTML and add Variables as Input Parameter. You can use that block to generate the HTML of your email and copy paste the HTML while composing mail through 3rd party. It was not for saving or sending the body through services.
I hope I am clear. Many thanks
Ah. Alas, the address I want to send from doesn't allow SMTP access as that was my first thought.
I think I get what you mean now. Web block with input parameters with escape content set to no. How do I then get just the html from that block? Output Param?
I didn't mean to save it. What I have understood from your post is you on some event or say getting values from customers you get their data and then in a preformatted html you used to replace the data manually and then use that HTML to send emails.
So, using the Web Block you can simply prepare the HTML (By fetching variables) and use the prepared HTML directly without requiring the manual changes.
Like, I have this as block
The Expression looks like
Then I have called the Block with Passing Variables
And HTML is Ready to Copy and Use
This is what I can see is solution to avoid manual intervention so far.
Hi,
We can use SMTPClientExtension forge component and enable bodyishtml property to true.