This is a migrated thread and some comments may be shown as answers.

send email - undisclosed recipients

4 Answers 64 Views
Cloud Code
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Max
Top achievements
Rank 1
Max asked on 18 May 2015, 03:58 PM

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?

4 Answers, 1 is accepted

Sort by
0
Accepted
Anton Dobrev
Telerik team
answered on 19 May 2015, 11:50 AM
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.
 
0
Max
Top achievements
Rank 1
answered on 20 May 2015, 04:32 PM
great trick, works as intended :)
0
Viktor
Top achievements
Rank 1
answered on 26 Sep 2017, 01:51 PM
Is this the same as defining Bcc in the Email template?
0
Anton Dobrev
Telerik team
answered on 28 Sep 2017, 11:19 AM
@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.
 
Tags
Cloud Code
Asked by
Max
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Max
Top achievements
Rank 1
Viktor
Top achievements
Rank 1
Share this question
or