Custom fields in email templates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pavel_s
    Junior Member
    • Apr 2018
    • 27

    Custom fields in email templates

    According to documentation
    It's possible to use placeholders in email template's body and subject e.g. {Account.name}, {Person.emailAddress}. They will be replaced with values of related records.
    But when template "is html" fields are shown like {Account.name}, {Person.emailAddress} - not the values of theese
    How can I fix it?
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Where? In compose view?
    What entity is parent for this email?

    Comment

    • pavel_s
      Junior Member
      • Apr 2018
      • 27

      #3
      I'm sorry(( my fault...
      We were trying to send email to Contact while adding {Lead.firstName}
      Next time I'll check for few times before create a topic.

      By the way
      is there any way to check if the Lead has firstName? because if don't he receives email with this {Lead.firstName}
      Thanks

      Comment

      • xurizaemon
        Junior Member
        • May 2018
        • 1

        #4
        Hey Pavel

        EspoCRM uses Handlebars.js, so I expect you can use the if block helper:
        {{#if Lead.name}} Kia ora, {{Lead.name}} {{else}} Greetings, new friend! {{/if}} More details: https://handlebarsjs.com/builtin_helpers.html

        Comment


        • pavel_s
          pavel_s commented
          Editing a comment
          Thanks a lot!
      Working...