Envio de email unico para vários destinatários

Olá,

Tenho um aggregate que possui uma entidade com dados pessoais, entre eles, o email. Pretendo, numa Action, enviar um único email para todas as pessoas dessa entidade. 

Sendo que os parametros do email (TO, CC, BCC) recebem dados do tipo "Text", como eu poderia fazer para, numa única variavel do tipo Text, passar todos os emails do aggregate?

Alguém já passou por isso?

Obrigada desde já.

Melhores cumprimentos,

Neide Gomes

Solution

Olá Neide,

Para conseguir isso tens de fazer o aggregate a essa entidade. depois fazer um loop com o for each e ir indo adicionando todos os emails tipo ListaEmails + "," +  <nome do aggregate>.list..current.email. depois usar essa variavel com todos os email no bcc (recomendado para n andar a partilhar o email de todo o mundo)

Cumprimentos,

Marcelo

In English for everyone else:

If you want to send an email to everyone in your database. Lets say you have an entity called Person with the users emails. You just need to query the entity with an aggregate and after that use a for each to loop through all the records and assign all the emails to the same text variable lets call it EmailList. Assign the emails like this EmailList + "," + GetPersons.List.Current.email. After that use the EmailList in BCC (recommended for not sharing the emails with everyone)

Regards,

Marcelo

Solution

Hello community, I will first explain to Neide why she must speak English and then I will translate her message.


Olá Neide, antes de mais, como estamos num fórum internacional, para conseguires uma ajuda mais eficaz deves escrever em inglês, pois se não por uma lado não terás toda a ajuda que poderias ter. Vou traduzir a tua mensagem, e a seguir vou ajudar-te.


Hello,

I have an aggregate that has an entity with personal data, including email. I intend, in an Action, to send a single email to all the people of that entity.

Since the parameters of the email (TO, CC, BCC) receive data of type "Text", how could I do to, in a single variable of type Text, pass all emails from the aggregate?

Has anyone ever experienced this?

In add the info who Marcelo said, please check this document.


Extra info:

Cheers,
Miguel

Marcelo Ferreira wrote:

Olá Neide,

Para conseguir isso tens de fazer o aggregate a essa entidade. depois fazer um loop com o for each e ir indo adicionando todos os emails tipo ListaEmails + "," +  <nome do aggregate>.list..current.email. depois usar essa variavel com todos os email no bcc (recomendado para n andar a partilhar o email de todo o mundo)

Cumprimentos,

Marcelo

In English for everyone else:

If you want to send an email to everyone in your database. Lets say you have an entity called Person with the users emails. You just need to query the entity with an aggregate and after that use a for each to loop through all the records and assign all the emails to the same text variable lets call it EmailList. Assign the emails like this EmailList + "," + GetPersons.List.Current.email. After that use the EmailList in BCC (recommended for not sharing the emails with everyone)

Regards,

Marcelo

Hi Marcelo, 

Thanks for your help! This solution worked :)

Thank you so much!

Best regards,

Neide Gomes

Miguel Verdasca wrote:

Hello community, I will first explain to Neide why she must speak English and then I will translate her message.


Olá Neide, antes de mais, como estamos num fórum internacional, para conseguires uma ajuda mais eficaz deves escrever em inglês, pois se não por uma lado não terás toda a ajuda que poderias ter. Vou traduzir a tua mensagem, e a seguir vou ajudar-te.


Hello,

I have an aggregate that has an entity with personal data, including email. I intend, in an Action, to send a single email to all the people of that entity.

Since the parameters of the email (TO, CC, BCC) receive data of type "Text", how could I do to, in a single variable of type Text, pass all emails from the aggregate?

Has anyone ever experienced this?

Hi Miguel,


Thanks for the alert, next time I will interact in English yes and I apologize to the whole community.

Best regards,

Neide Gomes

Miguel Verdasca wrote:

In add the info who Marcelo said, please check this document.


Extra info:

Cheers,
Miguel

Miguel,

Marcelo's solution is working as expected.

Thanks for help.

Regards,

Neide