HTML Templates: Show First Name in Order Confirmation

I've created an order confirmation for groups with a single barcode that they will bring with them to performances instead of printing out a stack of tickets. It's working great and now I would love to personalize it but can't figure out how. Right now it reads "Dear ORG NAME," and I'd like it to read "Dear First Name". How can I do that in the HTML template? I'm still figure all this out and haven't found a way to access just first name. Thanks for any help or guidance.

Melissa

Parents
  • Hi Melissa, 

    I am curious if you ever figured this out? We'd love to grab a salutation from the Initiator on our Membership as Product order confirmation greetings. 

  • Hi Eric and Melissa,

    I was able to get the constituent salutation by putting the following at the top of my template (or at least before the HTML display code):

    @using Tessitura.Service.Client.CRM;

    @{
    var constUrl = "CRM/Constituents/" + Model.OrderProductView.Constituent.Id + "/Snapshot";
    var getSnapshot = Model.RestClient.AtUrl(constUrl).Get<ConstituentSnapshot>().ResponseObject;
    var constituentSalutation = getSnapshot.Salutation.EnvelopeSalutation1;
    }

    And then wherever I want to display the salutation, I insert "@constituentSalutation" into my HTML, so it could be something like:

    <p>@constituentSalutation</p>

    Does that make sense? Hopefully that helps! Also we're not using TNEW either, but you don't need to be to access the API. That's what the templates in general are using.

    -Sara

  • Hey Sara!

    Thank you SO much. This worked flawlessly. We are part of a consortium so unfortunately we have to figure out how to get a specific salutation type. We fooled around for awhile yesterday and didn't get very far, but your code did work and has led us at least somewhat towards the correct path. 

    Thanks again!

Reply Children
No Data