Email template variables work from Contacts page but not Accounts page

I am using email templates within v7.10.6 (and have then applied the fixes in https://github.com/salesagility/SuiteCRM/pull/6017 which resolved a number of other issues).

Within the templates I have then used variables for example for things like $contact_first_name

When I send an email using the templates it works fine if done from the email address within the Contacts page, and the variable is replaced with the first name. If however I trigger it using the very same email address on the Accounts page (under the contacts section), it just shows the variable in the received email rather than replacing it with the first name.

I am guessing it is something to do with the relationship between contact and account, so I rebuilt the relationships and did a repair and rebuild on the off chance, but no luck. Also checked the suitecrm.log but nothing obvious showing in there either.

Any ideas?

Thanks

Andy

Just to expand slightly on this I have noticed that if I insert the company name using $contact_account_name it works fine, but if I do so using $account_name it doesn’t work. This also implies the relationship between the contact and account is not recognised for some reason.

I am not really sure if this expected behaviour or a bug.