Email Templates not filling in the data fields

Hi,
I have just installed suitecrm 7.1.4 on a Centos6, x64 server and I noticed that when using email templates to compose an email, the variables do not get replaced by the actual values; the receiver always gets something like(this is displayed on the CRM as well):
"
Hi $contact_first_name $contact_last_name,
We’ve received your case $acase_name (# $acase_case_number) on $acase_date_entered
Status $acase_status
Reference $acase_case_number
Description $acase_description
"
I enabled debug logging and noticed these 2 errors but I do not know what to do to fix ithem:
Sun Oct 19 01:52:22 2014 [9043][1][ERROR] Unable to load related bean by id
Sun Oct 19 01:52:22 2014 [9043][1][WARN] CaseUpdatesHook: saveEmailUpdate: Not a create case or wrong parent type

I made another fresh installation and I got exactly the same error.
On the other hand I noticed that at Inbound Email Queue which has

  • Create Case from Email: ON
  • New Case Auto-Reply Template: OFF
  • Auto-Reply Template: OFF
    there are still automatic emails triggered to sender(in correct format!); But if I enable “New Case Auto-Reply Template”(and select Case Create template) the sender gets 2 emails: one in correct format and another one as in the problem described above.

Maybe anybody has some ideas?
Thanks, Lau

Hi Lau,

How are you sending the emails, the variables get replaced when the email is sent.

Thanks
Lewis

Hi Lewis
I am trying to send manually emails from a case; I did not try via Workflows but I suppose that does not work either.
Thanks,
Lau.,

i’m having same problem. The email fills in data fields from the “client” module but does not for submodule “projects”.

Hi!

I have the same problem here with “cases”. I created a test case and sent an email from the email module using a case template.
The mail arrives without the variables being substituted.

Is this a bug?

Thanks
Dominik

Hi there,

Sending an email from the emails module, the CRM will not know which record to reference. These variables will work if the email is sent via AOW(Workflow) for example.

Thanks,

Will.

Hi Will,

thanks for the info.

But why can I select a specific case? I select that the E-Mail is linked to “cases” and then select the specific case. The CRM should then know which case to reference.

Is this a features planned for the future?

Thanks
Dominik

Hello,
I tried to send email manually and that time i chose the case by relate field in email to send email but no variables populated in email.

I got email same like the template no variable populate.
Please check this and guide me how can i populate the variables in email for cases module.

Regards:
Hemant Aseri

Hi Hemant

Did you resolve this?

I am getting the same behaviour for leads. No variables are replaced and the variable name is left a is. e.g. $lead_full_name

Cheers

Hello Nelem,
No didn’t get any solution for this. if you will find any solution please share with us.

Regards:
Hemant Aseri

I will if I am able. Are you able to send ANY emails via templates where the variables ARE replaced?

I now have this problem on three instances on the same server. These are all new instance so I don;t really know if they have ever worked.

OK, my problem seems to be different inasmuch as it is related to Leads. Contacts & Prospects (Targets?).

There is a line in modules/EmailTemplates/EmailTemplate.php that says

                      
 if($bean_name == 'Leads' || $bean_name == 'Prospects') {
	$bean_name = 'Contacts';
 }

So I tried using $contact_first_name instead of $lead_first_name is it was correctly expanded. There is more than meets the eye because not all variables are expanded. For instance $lead_assigned_user_name and $contact_assigned_user_name are not expanded at all despite the fact that both the lead and the contact are assigned to Administrator.

As this appears to be different from your problem, I’ll start a new thread.

Cheers

Hi Hemant

There is a line of code that determines which modules will be expanded for a email variables in modules/Emails/Emails.php around line 500. I added the Cases line below.

			if( isset($_REQUEST['parent_type']) && !empty($_REQUEST['parent_type']) &&
				isset($_REQUEST['parent_id']) && !empty($_REQUEST['parent_id']) &&
				($_REQUEST['parent_type'] == 'Accounts' ||
				$_REQUEST['parent_type'] == 'Contacts' ||
				$_REQUEST['parent_type'] == 'Leads' ||
				$_REQUEST['parent_type'] == 'Users' ||
				$_REQUEST['parent_type'] == 'Cases' ||
				$_REQUEST['parent_type'] == 'Prospects')) {

It now expands the case macros. Not sure if there are any further ramifications and hopefully SalesAgility can add some insight.

Cheers

Is anyone able to solve this problem? I also have this problem with SuiteCRM 7.2 and i don’t know how to check what’s wrong with this. Everything was normal but then suddenly it goes wrong like nothing filled in the variable name

I have the same problem. So looking for some help.

I’m having this same issue – the variables populate if I setup a workflow to trigger an email when a field updates, however if I manually create an email under “activities” in the module – even though the email is related correctly to that particular record — , the variables won’t populate when I send the email out (the email is received, just no variable substitution).

any help, general direction would be most appreciated –

Can some of the CRM gurus help the novices in this group. I have an email template and try to populate the following from the Opportunities table.My template looks like this.

“We are writing in reference to $opportunity_name. We are willing to submit our tender number $opportunity_quotenumber_c for the same. If you have any questions, please contact us.”

I was expecting that the fields will get populated with the information from the Opportunities table, but it does not happen. If somebody can help, I will be greatful.

I have the same problem.

I’ve tried Nelem’s fix from a few posts above and it did not work for me.

I’ve configured an inbound email with:
Import Emails automatically: yes
Create Case from Email: yes
Distribution: Round Robin
New Case Auto-Reply Template: MyTemplate

The case number variable gets replaced in the subject, but not in the body of the email…

I’ve opened an issue for this at: https://github.com/salesagility/SuiteCRM/issues/2294

Cheers,
Dave

Seeing same problem in Leads module, when sending a single email from a lead record using an email template, or adding variables during email composition.

-> Email goes out, but variables are not replaced with dynamic data!

e.g. $lead_first_name is shown in Email instead of the data from related lead record.

This works for Emails sent out of a workflow though.

I’m really hoping for a quick fix!