223
Views
3
Comments
Sending Emails from OutSystems
Application Type
Traditional Web, Mobile, Reactive, Service

Hi Folks,

I've a question on best practices that should be followed to send out emails. 

Below are the approaches that comes to my mind while sending out the emails:

1. Create an email template, drag it to the screen action (in traditional web), drag it in server action in reactive then use it that server action in the client actions (for reactive web & mobile apps).

2. Create an email template, drag it in a process (set this process as a light BPT), launch the process from wherever we want to send out the emails.

Can you guys help me decide the best possible way to send out emails from any type of OutSystems applications take into considerations about optimization, performance & memory management of the system. 


NOTE: In one of the Outsystems documentations, I remember reading that OutSystems has in-built capabilities of sending emails via a queue mechanism in the background & they keep trying to send out emails for 2 days if the sending fails. Is this correct?

2019-05-16 13-55-52
João Henriques

Hi Nehal,


I think it will depend on the use cases, you want to send the e-mail.


Here some questions:
- Do you want to send a e-mail after the a click of a button, or do you want to do a bulk send at a given time, or do you want to do both?

- How many e-mails do you expect to send daily?

- Is the e-mail template simple?

- Does the e-mail has attachments?

Thank you.


2023-12-11 08-54-13
Neha Agrawal
Champion

Hi Joao, 

1. We would be sending out the emails from the logic (automatic email sending), Eg., if a record is moved from draft status to submitted then we want to trigger an email.

2. Email traffic may differ for differ use cases.

3. The email templates may be both simple & complex (which includes data from tables with complex joins).

4. Attachments can be or cannot be available.


I am looking out for best solution to send emails irrespective of the frequency & content of the email. Maybe the answer can be hybrid like sending emails via client/serving actions good for emails with lesser frequency & for bulk emails processes might help.


What is an ideal way to achieve sending out email notifications?

2019-05-16 13-55-52
João Henriques

Hi Neha,

You can create a queue table to store the information that you need to send out a e-mail with the following fields:

  • Id
  • E-mail addresses
  • Subject
  • Type of Dispatch (every [n] minutes, hourly, daily, weekly, monthly, etc.)
  • Type of E-mail (here you can create a static to store the template id's)
  • WasSent (boolean)
  • CreationDate

And then you create a table to store the values that you need to the templates input parameters (to be more dynamic, you can store a JSON string and pass it to the template).


And then you can create timers that will run (every [n] minutes, hourly, daily, weekly, monthly, etc.) that can run the Server Action that will send the e-mails or can wake a BPT that will run it.

This should be created on a Core Module.

Hope this helps.

Thank you




Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.