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 41 posts 121 karma points
    Aug 07, 2020 @ 13:01
    Victor Bjørholm

    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 2765 posts 14046 karma points MVP 7x c-trib
    Aug 07, 2020 @ 13:13
    Matt Brailsford

    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}


    PS Here's an issue on the issue tracker where this was suggested / implemented

  • Victor Bjørholm 41 posts 121 karma points
    Aug 07, 2020 @ 14:03
    Victor Bjørholm

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

Please Sign in or register to post replies

Write your reply to: