send email - undisclosed recipients

3 posts, 1 answers
  1. Max
    Max avatar
    19 posts
    Member since:
    Jan 2015

    Posted 18 May 2015 Link to this post

    is it possible to send an email to multiple recipients without disclosing the email addresses to everyone?

    currently when sending an email via cloudcode to multiple recipients anyone that receives the email also gets the address of anyone else.

     

    if this is not possible what would be the best way to send a group of users an email? iterating the group and calling sendEmailFromTemplate for each user individually?

  2. Answer
    Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 19 May 2015 Link to this post

    Hi Max,

    I'd suggest the following approach:
    • Create a placeholder in the template like {{BccRecipients}} and place it in the Bcc field of the template.
    • Create a context when sending the template:
          var context = {
              templatePlaceholder1: "value",
              BccRecipients: ['user1@example.com', 'user3@example.com'] //either an array or a string with a single email
          };


    When sending the template use null for the recipients parameter:
    Everlive.Email.sendEmailFromTemplate(
            templateName,
            null,
            context,
            function(err, result) {...

    The email will be sent to the mails in the Bcc.

    Let me know if this works for you.

    Regards,
    Anton Dobrev
    Telerik
     
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
     
  3. Max
    Max avatar
    19 posts
    Member since:
    Jan 2015

    Posted 20 May 2015 in reply to Anton Dobrev Link to this post

    great trick, works as intended :)
Back to Top