Developer forum

Forum » Ecommerce - Standard features » Ability to set BCC mail on order notification mail

Ability to set BCC mail on order notification mail

Vincent Gercke
Reply

Is it in any way possible to set a BCC mail on a order notification mail? If not, how would you suggest I go about implementing the functionality? I can see I hook into the SendingConfirmationMail subscriber, but it doesn't look like I can set a BCC mail from what I can see in the documentation.

Thank!


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

What about just setting up a new email in the Cart module? It won't technically be a BCC but the results will be the same; someone else will get an email.

 
Vincent Gercke
Reply

Unfortunately, It needs to be a BCC since it is used to activate this Trustpilot feature:

https://support.trustpilot.com/hc/en-us/articles/213703667-Automatic-Feedback-Service-AFS-2-0-setup-guide

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer

Looks like they have a solution for when you don't have a BCC field.

But if you go the subscriber way, SendingConfirmationMailArgs (the Args class for the SendingConfirmationMail notification) exposes a MailMessage property. To that you should be able to add the Bcc, sort of like this (typed here, not tested):

[Dynamicweb.Extensibility.Notifications.Subscribe(Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.SendingConfirmationMail)]
public class EcomCartSendingConfirmationMailObserver : Dynamicweb.Extensibility.Notifications.NotificationSubscriber
{
    public override void OnNotify(string notification, Dynamicweb.Extensibility.Notifications.NotificationArgs args)
    {
        var sendingConfirmationMailArgs = (Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.SendingConfirmationMailArgs) args;
        sendingConfirmationMailArgs.MailMessage.Bcc.Add(new MailAddress("someone@example.com");
    }
}

Does that help?

Imar

Votes for this answer: 1
 
Nicolai Pedersen
Reply

Hi Vincent

In the cart settings on the paragraph, you can create any number of notifications - so you can just send a specific mail to Trustpilet.

Something like this:

 
Vincent Gercke
Reply

Thanks! I'll to see if we can solve it by using the cart notification settings and otherwise use the observer approach.

 
Martin Ottesen
Martin Ottesen
Reply

Hi Nicolai,

Using notifications does not work when sending emails to Trustpilot, because we don't just want to send the confirmation to Trustpilot. We want to send the customer's email to Trustpilot, which is why it has to be in the bcc field so that we get both the customer email and the Trustpilot mail included in the confirmation email.

Just sending the order confirmation to Trustpilot does not do the trick unfortunately 

 
Roald Haahr
Reply

Thank you for the subscriber, Imar. It did the trick :)

 

You must be logged in to post in the forum