Send email to a list of people

Hi!

How can I send an email to a list of people in a database??

Thank you

Hello Susana.


That question is very broad. 

There are a few steps you need to do.

1) configure OS to send email https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/Configure_OutSystems_to_Send_Emails

2) Create one email template https://success.outsystems.com/Documentation/11/Developing_an_Application/Implement_Application_Logic/Send_an_Email_From_a_Web_Application

3) Prepare your logic to loop a list of addresses and send one email to each one.


I'd advise you to follow the training to have a good idea of everything. If you have any specific doubt, please ask us.

Solution

Susana Nunes wrote:

Hi!

How can I send an email to a list of people in a database??

Thank you

Hi Susana, you can do a for each and send the email, check the pic bellow

here you are using an aggregate to get the information you need after you iterate by the position on the list and send the email using the current email


Check the oml attached Edit:(change the preparation to have an action to send the email)


Hope I could help you

Best regards

Carlos Lessa

Solution

Nuno Reis wrote:

Hello Susana.


That question is very broad. 

There are a few steps you need to do.

1) configure OS to send email https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/Configure_OutSystems_to_Send_Emails

2) Create one email template https://success.outsystems.com/Documentation/11/Developing_an_Application/Implement_Application_Logic/Send_an_Email_From_a_Web_Application

3) Prepare your logic to loop a list of addresses and send one email to each one.


I'd advise you to follow the training to have a good idea of everything. If you have any specific doubt, please ask us.

I have a database with a list of students. And I want to send an email with information to all students in the database. I already configure OS to send email.

Thank you


So you are set to go.

Carlos' example (Query list of email, Loop and send email) is what you need to do. Just be careful about running it, because it sends the emails before opening the page.

In development servers you can set to send all emails to a single email address (as in, not the one read from database) to prevent mailing everyone by accident.
Because I don't know if you did that, I did a small adjustment so you can list the people and after checking the addresses you send the emails.



Carlos Lessa wrote:

Susana Nunes wrote:

Hi!

How can I send an email to a list of people in a database??

Thank you

Hi Susana, you can do a for each and send the email, check the pic bellow

here you are using an aggregate to get the information you need after you iterate by the position on the list and send the email using the current email


Check the oml attached Edit:(change the preparation to have an action to send the email)


Hope I could help you

Best regards

Carlos Lessa

Susana, just changed the oml to not have on the preparation and send the email, now is in a button, anyway is just an example to use on your case

Cheers

Carlos Lessa


I created a database with only one person (name and email). I created the button and the screen action. I can't receive the email! (SendEmail in attachment)

Thank You

Susana Nunes wrote:

I created a database with only one person (name and email). I created the button and the screen action. I can't receive the email! (SendEmail in attachment)

Thank You

Hi Susana, did you configure the default Sender email and Sender name on Sevice Center?


Yes, I did

If you didn't configure you should see an error like that in the service studio if you turn on the debug and add a breakpoint

Follow this link to know how to configure or how to turn on the Redirect to test list

https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/Configure_OutSystems_to_Send_Emails

Best regards


Susana Nunes wrote:

Yes, I did

Can you check the log and see if there are errors in sending the email?

btw sometimes the email is not sent asap and it takes a little to arrive


Susana check if these configs are correct to your email


And I remember when I was doing a test while ago and I added in another OS account my Gmail, didn't work well, was necessary to change something on my setting of Gmail. check if isn't that your case


Best regards

Carlos Lessa

To complete Carlos' references:


  • The extra step in Gmail is to turn off two-step authentication.

Go to https://myaccount.google.com/

Choose Security (left menu)

Under the Start Session section, you have a two-step authentication entry that must be off.

The Portuguese version will be something like this.


  • Regarding the logs, they are in the Monitoring -> Email section of Service Center

[yourserver]/servicecenter/Email_Logs.aspx


Now sent with a looooong delay!! Thank you for the help :)

Susana Nunes wrote:

Now sent with a looooong delay!! Thank you for the help :)

Good we could help you.

Now to help others with the same question as yours to find the proper answer to your post, mark as Solution the question that helps you most.

Best regards

Carlos Lessa