Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi there, could you please advise how to send a second "Order Confirmation" email to an administrator?
I've created a second template and duplicated orderConfirmation as a base (new one is adminOrderConfirmation) - with the only change being the subject line at this stage, yet only orderConfirmation is being sent/received.
Is there something I've missed with this process above, or will I need to implement a pipeline to handle this? And if so, how would I go about picking up a different template file?
We currently only have the ability to automatically send one confirmation email, but you can hook into Vendr's event system to trigger sending your own email.
You should be able to register an event for the OrderFinalizedNotification notification (See docs here for registering event handlers https://vendr.net/docs/core/2.1.0/umbraco-v9/key-concepts/events/) and then use the IEmailTemplateService to retrieve your email template and call the services SendEmail method to trigger sending it.
Hope this helps
Thank you Matt, unfortunately this build is still on Umbraco 8 - and using Vendr 1.8, does this still apply?
It does yea, just switch the docs to the v8 version https://vendr.net/docs/core/2.1.0/umbraco-v8/key-concepts/events/
Brilliant, ok so far I have the following - is this correct so far, and how do I do these next bits? Thank you
public class MyOrderFinalizedComposer : IUserComposer
public void Compose(Composition composition)
public class MyOrderFinalizedHandler : NotificationEventHandlerBase<OrderFinalizedNotification>
public override void Handle(OrderFinalizedNotification evt)
var orderLine = evt.Order.OrderLines?.First(x => x.Properties != null && x.Properties["formEntry"] != null);
if (orderLine != null)
// use the IEmailTemplateService to retrieve your email template
// call the services SendEmail method to trigger sending it.
Yup looks good so far.
For the last bits you'll want to use dependency injection to inject the IEmailTemplateService into your notification handler, then store it in a private variable to be accessed within your handler.
Where you have the code comment, you'll then want to access that service instance to fetch your template (by alias would be easiest) and then call SendEmail on the service to trigger sending it.
There are some docs here on dependency injection https://vendr.net/docs/core/2.1.0/umbraco-v8/key-concepts/dependency-injection/
Brilliant thanks for that
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted