Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alessandro 31 posts 152 karma points
    Mar 28, 2022 @ 08:07
    Alessandro
    0

    Update order properties before confirmation email is sent

    Hello Matt, I need to update properties of an order with custom information that need to be included in the confirmation email.

    I tried to do things in the OrderFinalizedNotification, but it appears it is fired after the email is sent.

    Is there any event that is fired just before the mail is sent?

    Also, is there any documentation with the list of events and when they are fired? I had a quick look at the docs but I couldn't find one.

    Thanks in advance, Alessandro

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Mar 28, 2022 @ 08:20
    Matt Brailsford
    100

    Hi Alessandro,

    We don't currently fire an "EmailSendingNotification" though that probably a good idea so I'll add that to our issue tracker.

    For your scenario though, you could probably switch to the OrderFinalizingNotification as this will run just before the order is finalized and before the confirmation emails are sent.

    Alternatively, you could still register the event on OrderFinalizingNotification if you need to ensure the order is finalized before you set the properties, but you can register your handler before Vendr's event handler that sends the emails.

    builder.WithNotificationEvent<OrderFinalizedNotification>()
        .RegisterHandlerBefore<SendFinalizedOrderEmail, MyHandler>();
    

    Hope this helps

  • Alessandro 31 posts 152 karma points
    Mar 28, 2022 @ 08:31
    Alessandro
    0
    builder.WithNotificationEvent<OrderFinalizedNotification>()
    .RegisterHandlerBefore<SendFinalizedOrderEmail, MyHandler>();
    

    Brilliant!

Please Sign in or register to post replies

Write your reply to:

Draft