I am trying to send a test email using sendgrid to multiple recipients. I used the following as a starting point : https://github.com/sendgrid/sendgrid-google-java
I would all like the users receiving the email also be able to see all the other users on the TO field when they receive the email. Using the mail.addTo API sends the email to all the users however the email is sent individually to all of them (they can't see who all they message went to).
Basically my use case is to send an email to a few users and they should be able to "Reply all" and start communicating with each other. How can I achieve this using appengine/sendgrid/java?
Something must have changed in the implementation, I'm using sendgrid-java-3.1.0.jar.
My code,
Mail mail = new Mail();
...
Personalization p1 = new Personalization();
p1.addTo(new Email("[email protected]"));
p1.addBcc(new Email("[email protected]"));
mail.addPersonalization(p1);
This appears to work as expected.
If you want that users could see all list of recipients you can create one personalization for all user list:
var mail = new Mail();
var personalization = new Personalization();
personalization.addTo(new Email([email protected]), name1));
personalization.addTo(new Email([email protected]), name2));
mail.addPersonalization(personalization);
If you want that user could see only themselves - you can specify personalization for each recipient:
var mail = new Mail();
var personalization1 = new Personalization();
personalization1.addTo(new Email([email protected]), name1));
var personalization2 = new Personalization();
personalization2.addTo(new Email([email protected]), name2));
mail.addPersonalization(personalization);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With