email template variables not populated in emails sent


I created an email template and put several variables in the body of the email and in the subject line. I then created a campaign to email targets in a Target List. I also created a “Test” Target List with one target in it. After setting up the campaign, I clicked the button to “Send Marketing Email as Test”. When the email is sent, the variables are not populated with the data from the Target, instead, the actual variable names (e.g. $prospect_name or $prospect_primary_address_city) are in the email. What could I be doing wrong?

Note, I am running SuiteCRM version 7.8.17.


Can you please try sending that email from the template, but not from a campaign, to see if it makes any difference?

Just go to Emails, compose, select that template, relate email to that target, send.

Maybe your Issue is the same as this one:

It’s an old story. Here is the same issue being discussed. There is still no result. You may use variables referencing Contacts, Leads or Targets but any other variables are not populated when email is generated.

My concern is whether there is a Github issue for this or not, and whether any existing Github issue describes the problem well.

Nothing on this project gets fixed without a GitHub Issue. So please guys, do the tests I ask, if you can, and help me find the best place to report this and the best way to report this. Thanks.

Thanks reznik and pgr,

The problem I’m having is the same that reznik indicated above (Here is the previously reported issue).

I have to insert a variable from “Contact/Lead/Target” instead of from “Target”. Seems to be a bug as previously reported.


If anybody can please do the test I asked in this post, and confirm that the github issue linked there is the correct one, we can update that Issue to include more information and get this on the path to resolution.

Hi pgr,

The problem I am experiencing sounds similar to that listed in GitHub, however, there is not enough detail in the GitHub description to determine if it is the same issue. For example, the GitHub description describes that some of the <$contact_…> variables are not associating with the underlying data and showing in emails of a campaign. The GitHub description does not indicate that all variables connected to a category of variables are not associating with the underlying data (i.e. “Targets” or “Leads” variables do not associate and instead only “Contact/Lead/Target” variables do associate) .

Also, I am not running the version specified in the GitHub post, I am running 7.8.17.


This is what I asked for

If that result matches the description on the GitHub issue, I would be happy to widen the scope of the Github issue to include more variables, like you say.

Hi pgr,

I just tried sending that email from the template and the same thing happens, only the variables I used from “Contact/Lead/Target” associate with underlying data and the variables from “Target” do not associate.


1 Like

Hello, everybody!

Pgr, thank you for your attention.

Let me try to sum everything up. I found a previously reported bug #3321. If I am not mistaken, it is a clone of our topic. But I am still in two minds if it’s a bug. On one hand, we are free to use any existing email template containing any variables referring any modules. (Honestly, I think that’s how it should work.) On the other hand, Email Variables droplist imposes restrictions. When inserting a variable you are limited to use just Contact/Lead/Target variables. That looks like a conflict, doesn’t it?

1 Like

Thanks, that’s useful. I commented on that issue.

I have similar issue.
Created template where the link URL has $lead_id in it.
The URL in template looks like this:
When composing the email manually out of the template - it works fine and the link populated correctly.
Once I try to set up a workflow to use this template or send it as campaign to bulk of leads, the URL is messed up.
Receiving link with this URL:
There 2 problems:

  1. it cuts out the domain and inserts 2 dots instead
  2. The lead ID is not inserted or sent as it is in template.

Using version 7.11.15

As I can see it is an old issue. Is there any updates about solving it?

I’ve been working on this in the past months for this add-on.

If you need to go fix the code yourself these notes I published here might help.

Hi pgr,
See my Screenshot,In that i insert variable of account that i tested from Email module->Compose email but still it coming like that