Some email variables do not work anymore after upgrade to 7.10.2

After upgrading to 7.10.2, I noticed the variable $contact_first_name does not get replaced anymore for my leads in my email templates sent via an email Campaign.

Anybody know where to start and why this happens ?

Thanks !

Do you see anything in suitecrn.log or php_errors.log that might offer some clue?

Thanks

To be honest, I’ve checked the logs but I don’t really know what I am looking for…

You can look for any messages of type ERROR or FATAL, these are usually the most important.

Ir you can try to action that is giving you problems at a time when you are sure nobody else is using the system (or force it by unplugging the network cable), and check what time it is, and then focus on the part of the logs at that specific time.

OK. Thanks. Got it :

Mon Apr  2 23:15:38 2018 [3105][1][FATAL] Variable $contact_first_name  could not be parsed, because attribute first_name does not set in contact bean

That’s strange… Is it ?

Interestingly, the variables $contact_full_name, $contact_name and $contact_last_name are working fine.

That seems to be coming from here

modules/EmailTemplates/EmailTemplateParser.php:189:            'Variable %s could not be parsed, because attribute %s does not set in %s bean',

and that code has been heavily refactored very recently, so something must have gone wrong in one of those changes. I’ll ask the developer tomorrow.

https://github.com/salesagility/SuiteCRM/commits/master/modules/EmailTemplates/EmailTemplateParser.php

Meanwhile, do you have a first_name set in that record? The error message seems to complain about that-

I feel stupid to ask but in what record do you want me to look in ?

It’s always ok to ask, I guess :slight_smile:

I mean whatever record (Contact) the email template is trying to use to replace the variables. So if you’re sending email to a Contact that does not have a first_name set, that might be confusing the script. Although it obviously needs to be able to handle those cases…

Ok. So what I just did it a test template featuring all the name variables i.e :

$contact_name
$contact_salutations $contact_first_name $contact_last_name
$contact_full_name

They all worked fine except $contact_first_name.

And yes, I’ve made sure the field “First name” is filled with some data.

The former behaviour was nothing was displayed in the email body when a field is empty. Now whether the field is empty or not doesn’t make any difference “$contact_first_name”, as is, will be displayed every time.

Thanks, that is all useful information. I’ll try and get this fixed.

1 Like

7.10.3 update fixed it ! Thanks

Hello Friends,

I am also facing the similar problem. In my email template, I am having the following variables:

My Campaign is failing and suitecrm.log is showing the following errors:

Thu May 24 08:25:48 2018 [229486][1][FATAL] Variable $contact_first_name  could not be parsed, because attribute first_name  does not set in contact bean
Thu May 24 08:25:48 2018 [229486][1][FATAL] Variable $contact_middle_name_c  could not be parsed, because attribute middle_name_c  does not set in contact bean
Thu May 24 08:25:48 2018 [229486][1][FATAL] Variable $account_name could not be parsed, because attribute name does not set in account bean
Thu May 24 08:25:48 2018 [229486][1][FATAL] Variable $account_billing_address_city could not be parsed, because attribute billing_address_city does not set in account bean
Thu May 24 08:25:48 2018 [229486][1][FATAL] Variable $account_billing_address_state could not be parsed, because attribute billing_address_state does not set in account bean
Thu May 24 08:25:48 2018 [229486][1][FATAL] Variable $account_name could not be parsed, because attribute name does not set in account bean
Thu May 24 08:25:48 2018 [229486][1][FATAL] Variable $account_billing_address_city could not be parsed, because attribute billing_address_city does not set in account bean
Thu May 24 08:25:48 2018 [229486][1][FATAL] Variable $account_billing_address_state could not be parsed, because attribute billing_address_state does not set in account bean
Thu May 24 08:25:48 2018 [229486][1][FATAL] SugarPHPMailer encountered an error: SMTP Error: data not accepted.
Thu May 24 08:25:48 2018 [229486][1][FATAL] SugarPHPMailer encountered an error: SMTP Error: data not accepted.
Thu May 24 08:25:48 2018 [229486][1][FATAL] Email delivery FAILURE:Array
(
    [date_entered] => 2018-05-23 19:30:46
    [date_modified] => 
    [user_id] => 1
    [id] => 3814
    [campaign_id] => cb9ecece-3ed6-54a1-b209-586f82b14001
    [marketing_id] => ce477a9c-4a2f-0590-369b-5b05c0a6d249
    [list_id] => cbd7d718-9921-eeda-c6c1-5affeb7ede44
    [send_date_time] => 2018-05-23 19:45:00
    [modified_user_id] => 
    [in_queue] => 0
    [in_queue_date] => 
    [send_attempts] => 0
    [deleted] => 0
    [related_id] => e7534fc7-4785-a9d1-56ac-5aff22dd4c7e
    [related_type] => Contacts
    [related_confirm_opt_in] => 0
)

Thu May 24 08:25:48 2018 [229486][1][FATAL] Email delivery error:Array
(
    [date_entered] => 2018-05-23 19:30:46
    [date_modified] => 
    [user_id] => 1
    [id] => 3814
    [campaign_id] => cb9ecece-3ed6-54a1-b209-586f82b14001
    [marketing_id] => ce477a9c-4a2f-0590-369b-5b05c0a6d249
    [list_id] => cbd7d718-9921-eeda-c6c1-5affeb7ede44
    [send_date_time] => 2018-05-23 19:45:00
    [modified_user_id] => 
    [in_queue] => 0
    [in_queue_date] => 
    [send_attempts] => 0
    [deleted] => 0
    [related_id] => e7534fc7-4785-a9d1-56ac-5aff22dd4c7e
    [related_type] => Contacts
    [related_confirm_opt_in] => 0
)
SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: Mail denied for blacklisted authenticated user (From address:
"LUMINIS CONSULTING SERVICES PVT. LTD" <xyx@luminisindia.com> IP:
103.21.59.174 AuthenticatedID: xyz@luminisindia.com Account owner:
ABC)
 SMTP code: 550

Kindly suggest what I can do to solve this problem.

With thanks,

RK

In case anybody wanders into this thread in the future, this discussion continued on Github and a fix is ready

https://github.com/salesagility/SuiteCRM/issues/5944