Developer forum

Forum » Development » Attaching file to confirmation mail.

Attaching file to confirmation mail.

Martin Skov Nielsen
Reply
Hi. I'm looking for a way to attach an xml file with order information to the e-mail that is sent to the shop owner after a purchase has been made in eCom.

Should I write my own checkout handler or what is the best way to go?


Replies

 
Nicolai Høeg Pedersen
Reply
It is not the CheckoutHandler that sends the e-mail - it converts the cart to an order doing stuff, i.e. a paymentprovider.

You cannot hook into the mail being sent as it is now - but you can create an observer for Notifications.eCommerce.Cart.SendMails that is broadcastet just before DW sends out the mails. In there you can create your own or additional mail containing the XML document.

have created a backlog item that will broadcast a notification for every mail send.

 
Martin Skov Nielsen
Reply
Ya - I was just reading the eCommerce Extensibility API - and realized that notification providers was the way to go.
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
have created a backlog item that will broadcast a notification for every mail send.  

 

It would be great if the NotificationArgs object then exposed a proper MailMessage instance, enabling our code to modify the message in any way we see fit (add recipients, change subject / content, add attachments, embed images and so on). Is that something you had in mind for this backlog item as well?


Imar

 
Nicolai Høeg Pedersen
Reply
@Imar

Of course.

This is the task I registered:

****

We have Notifications.eCommerce.Cart.SendMails in eCommerce.Cart.Frontend.SendMails - I also want a notification inside the

For Each recipientMail As Net.Mail.MailAddress In recipients.Distinct() loop with the mail object, recipient object, order object and modulesettings object.

 

The parsed arguments object should also have a property called "SkipSending" or something like that, that, when set to true, will skip sending that mail.

 

Can be used for attaching stuff to mails etc.
****



 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Perfect!

Imar

 

You must be logged in to post in the forum