Email Template field not populated when the email template is generated

Hello,

I am created an action button which will open a pre-composed email using an email template.  All very normal stuff.
(note, Not 'process email template', just the 'email template')

I have a custom field in our Leads module which is an auto increment and lets us give each Lead a number.

This is all fine... and has been in place for years.

   

I now want to add this field into the email template, but it never populates iwhen the email is generated?
Other fields do, but not this one.

  

In the email template Insert Variable section I can find the field: (i think this is the field anyway!)

So that comes up as:  $contact_lead_number   

  • This just results in a blank where is should be in the template after clicking the button:
      

    Results in:


It is an existing record too, not a new record, so the DB definitely has a value in there:
If I use Postman with endpoint (GET): {{url}}Leads/_record ID here_  (to get everything for that record)

I can confirm the field is the correct one and has a value: 
"lead_number_c": 4943

  

In the email template I have tried using  just $lead_number_c, but that just prints into the email as written...
So does trying $lead_lead_number_c  (thinking instead of contact_lead_number_c)

  

I must be missing something?  Or does it sound a bit buggy?

Thanks in advance for any tips,
Luke.

Parents
  • Hi Luke,

    I'm working on something similar for Web to leads and whilst I can't offer a solution to the field not appearing for you :( I wondered if I could ask how you got the Email action button to populate with, in your case the contacts email address as the Send To - if this is a correct assumption?  My template works and also pulls through my signature but it doesn't populate the 'Send To' in the email?

    TIA

    Samantha

Reply
  • Hi Luke,

    I'm working on something similar for Web to leads and whilst I can't offer a solution to the field not appearing for you :( I wondered if I could ask how you got the Email action button to populate with, in your case the contacts email address as the Send To - if this is a correct assumption?  My template works and also pulls through my signature but it doesn't populate the 'Send To' in the email?

    TIA

    Samantha

Children
  • Hi ,

    At least for standard Sugar modules (Contacts, Leads, Users), you can populate the record's primary email address in the email by using the $email1 field variable. Here's an example of how the action button would be configured to populate the lead's primary email address:

    If you wanted to populate an associated user's email address (e.g. assigned user), then you would use a related function like:

    related($assigned_user_link, "email1")

    One thing to note is that the action button appears to only allow for a single email address. I could not find a way to have it automatically inject multiple email addresses. The closest I came was using a concat formula to retrieve multiple email addresses and separate them by a comma or semicolon, but the email compose screen treated that entire string of email addresses as a single email recipient. 

    Chris