send email - undisclosed recipients

5 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
    607 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 :)
  4. Viktor
    Viktor avatar
    14 posts
    Member since:
    Dec 2011

    Posted 26 Sep Link to this post

    Is this the same as defining Bcc in the Email template?
  5. Anton Dobrev
    Admin
    Anton Dobrev avatar
    607 posts

    Posted 28 Sep Link to this post

    @Viktor

    As specified here the Bcc field is described when creating a template programmatically to have hardcoded list of Bcc recipients for this template. 

    In the example I shared, one can use a placeholder to populate dynamically the BCC recipients for each email message sent with using this template. 

    Technically, I think we speak of two different usages for the Bcc here.  

    Regards,
    Anton Dobrev
    Progress Telerik
     
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
     
Back to Top