Developer forum

Forum » Integration » Add option to CC/BCC an address on the user provider

Add option to CC/BCC an address on the user provider

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

One of our customers asked for the option to BCC an internal account for each email that is sent automatically for each newly created user when using the User Provider. Is there a way to do that today with, for example, tapping into a subscriber or some other solution?

If it can't be done, would it make sense for me to file it as an enhancement request?

Imar


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Imar,
it seems there is a way for this by subscribing to the Notification subscribder: Dynamicweb.Mailing.Notifications.EmailNotifications.OnBeforeEmailSend and in this subscriber you can access the System.Net.MailMessage email object and modify it to include the BCC.
You will also need to decide how to recognize that the email in this Notificaiton subscriber is from the User Provider by checking maybe an email subject/from email/email body containing User provider tags(DWUsers:User:Username/DWUsers:User:Name/DWUsers:User:Email) etc.
Best regards, Dmitrij

 
Nuno Aguiar
Reply

Hi Dmitriy,

 

One quick suggestion on the side

Maybe it would make sense to add a source parameter (probably an enum), so in the subscriber we can more easilly identify where the email originated from (Forms for Editors, Order flow notification, Shopping Cart module, Email Marketing, Recover password...).

 

We start to see the use of the Mailing notifications more and more, and althrough should be pretty simple and lightweigh to add a source by module/feature

 

Best Regards,

Nuno

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Yeah, I like that idea; that would be great to have.

Thanks Dmitriy, I'll give that a try.

Imar

 

You must be logged in to post in the forum