16
Views
2
Comments
Solved
How to dynamically display Table Records in Email body as tabular format?
Question

Greetings.

Here is my scenario. 

I'm trying to schedule an email report using timer. Report is a Table record which will be loading from external DB.

As there is no email option in React web, My Email sender app is traditional web and Consumer app is React web. Email will be triggered from React web. 

How do i pass records list from react web to the  traditional web email body?i want to display the data in tabular format.

Appreciate your support.

If possible can someone share a sample.



Rank: #55
Solution

Hi Jim Mathew,


The best way to show data in an email is have the data persisted on your database so that you can fetch it with a query in the Preparation of the Email, like you do on any other Traditional Web screen. In the case, you need to have the table filtered by some value, have this value passed in as an input parameter of the Email and use it as a filter of the query, like I do on the email below, using the UserId input parameter:


Regarding styling, as far as I know, emails don't have a theme, so you need to have the CSS you need on the style sheet of the email. So in this example, I fetched the Table Records CSS from OutSystems UI and pasted it in the Style Sheet of the Email.


If you have several emails that you use the same CSS, I suggest to create an EmailLayout web block with the CSS and use it on every Email screen to avoid having the same CSS copied and pasted on every email.


OML in attachment with the aforementioned example.


Regards,
João

TWEmailWithTable.oml

Rank: #22466

Hi João ,

Thanks a lot for your quick response. It was really helpful.