Copied to clipboard

Flag this post as spam?

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


  • Victor Bjørholm 58 posts 180 karma points
    Aug 07, 2020 @ 13:01
    Victor Bjørholm
    0

    Set subject line of email template programmatically

    Hi Matt, The question is as simple as the title. I have my email eventlistener up and running, but would like to be able to set my email template's subject line to be equal to the order ID

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Aug 07, 2020 @ 13:13
    Matt Brailsford
    100

    Hi Victor,

    The email subject line supports dynamic template functionality so you should be able to set it to something like

    Order {Model.Id}
    

    Where Model represents the model object you pass to the SendEmail method, so assuming that is an order, it will be output the order ID.

    You can access any properties on the model object in the template, even nested data

    Thank you {Model.CustomerInfo.FirstName} for your order {Model.OrderNumber}
    

    /Matt

    PS Here's an issue on the issue tracker where this was suggested / implemented https://github.com/vendrhub/vendr/issues/107

  • Victor Bjørholm 58 posts 180 karma points
    Aug 07, 2020 @ 14:03
    Victor Bjørholm
    0

    Hi Matt, Alright, thank you very much. Got it working now!

Please Sign in or register to post replies

Write your reply to:

Draft