Send emails from another entity

Send emails from another entity

  

Hi!

I have a timmer with the following struture:

The timmer trigger without problems for all emails that i manually put in the "To:" field (red).

My problem: I need that the "To" field populated with an atribute (Email) from another entity (EmailsConfig). I have alredy use the assign function and agregate the entity in this struture, but the sending dont work or generate any log errors.

I appreciate some help in this issue.

Thanks.

Nuno Bernardo

Solution

Hello Nuno Bernardo,

by looking to your implementation, why are you iterating the list returned from the queries? if you only send out an email at the end (false branch).

Also to do what you describe, my suggestion is to add an aggregate on the top of the timer that will fetch (from the email config entity) the email to be assigned to the "To" field, so you can use the aggregate output directly in the send email widget.

Let me know if you managed to overcome the issue,

Hugo Pinheiro


Solution

Hello,

My logic for the implementation was: From agregate have 2 filters... so if this agregate is not empty, then send an email. This works fine, but other suggestions are welcome :)

I use your suggestion but dont work. Probably i have missed something. I aggregate the entity with the emails and in To field: 

SyntaxEditor Code Snippet

GetEmailsConfigs.List.Current.EmailsConfig.Email

What i'm doing wrong?

Regards,

Nuno Bernardo

Solved. In my Email configuration i have checked Redirect Emails To Test List:

Regards,

Nuno Bernardo