I've noticed that if you send an Email Campaign to multiple Contacts/Leads/Targets that only one email record (the template) is saved in the CRM. This results in a few issues with History subpanels etc.
If for example a Campaign Email is sent to multiple Contacts, in the History subpanel for those Contacts that received the email, the email record displayed for each is the same record and will not have individual content such as parsed variable names and the 'to' address appears to be null on the email. I have also noticed occurrences where the former is not the case but the variables are parsed for one of the Contacts and the 'to' address is populated with that Contact's email address, however this same content is displayed for all Contact's the email was sent to if you view it through their History subpanel.
Another implication is that if you view any of the Contact's related Account, the History subpanel will display the same 'Contact Name' on each. Due to there being only one email record stored (which is related to all Contacts it was sent to), there is no surefire way to display the correct 'Contact Name' on an Account's History subpanel as the Email may have been sent to more than one Contact related to that Account.
I would expect that each Email sent via a campaign would be saved as an individual record so that they can be individually related to each Contact/Account/Target/Lead the Campaign was sent to. I would also expect the History subpanel on Accounts to display individual Emails for each Contact related to that Account that the Campaign was sent to along with the correct 'Contact Name'.
Only one Email record is saved which is related to every record it was sent to, making it impossible to view the actual Email content that was sent to a specific Contact/Account/Target/Lead and making it impossible to display the correct 'Contact Name' on an Account's History panel with 100% accuracy.
Save emails individually for each Contact/Account/Target/Lead the Campaign is sent to.
I feel this should be a high priority as it prevents the correct Contact Name from being displayed on Accounts' History subpanels which is confusing to Users. It can also be confusing to Users who are viewing the Email via a Contact's History subpanel as it will display un-parsed content (from the template) or incorrect information such as the wrong 'to' address.
@Jason-Dang I seem to remember reading a code comment somewhere mentioning this - something explaining that this is deliberately done for performance/maintenance reasons. If you send thousands of emails and create thousands of records, over and over again, your database can grow tremendously.
But I do also see the point in your reasoning. I wonder if there is some middle-ground, like keeping the single record but treat it as a special case, finding a way to display the correct contact name when viewed. I'm not sure this is possible, though.
@pgorod Yes I understand your point that saving individual records for each email could be taxing on data storage and cause performance issues so that wouldn't actually be an option.
I do think some sort of workaround is needed though to both show the email in context for each person it has been sent to and to display the correct Contact(s) in the Account History sub-panel.
I have an idea at how this middle-ground might be achieved.
For displaying the correct Contacts' name in the Account History sub-panel, I think the only real solution would be to match all the Contacts that are related to the email with the Contacts related to the Account.
In the case of only one Contact being matched, that Contact's name can simply be displayed in the sub-panel. In the case of multiple Contacts being matched then a count of those Contacts be displayed in the sub-panel and those Contacts names can be viewed on click via a tool-tip or popup.
Alternatively to displaying the count of matching Contacts, the email could be displayed multiple times in the sub-panel, one for each Contact match. This would allow for only one name to be displayed for each row in the sub-panel.
In regards to viewing the email in context for specific recipients (i.e. Contacts, Accounts, Leads, Targets) I believe it could be added as a feature to the Emails module for Campaign emails. This could make use of the already existing sub-panels by adding an option/button to view the email for specific recipients with the default showing the email template variables (as it currently does). A request could then be made to retrieve the relevant information using the given id and parse the email variables and populate the 'to' address.
What are your thoughts on this?
Just in case you missed this: In Admin>Campaign Email Settings there's a setting called
"Keep copies of campaign messages:"
If you change this to yes, SuiteCRM should save every individual Email message instead of only the template.
@Jason-Dang did you checked the "Keep copies of campaign messages:" in Campaign Email Settings ? as @EZS-JD asked?
Closing due to inactivity. If this is still an issue, please update
Hello,
I just sumbled on same issue.
It seems, that issue is corrected if one change field fill_in_additional_fields from true to false in
modules/Emails/metadata/subpanels/ForUnlinkedEmailHistory.php
Just checked, that in Accounts subpaanel Contact field is empty, which is OK, since mail was sent to Account, not Contact.
And I checked History in Contacts and it correctly print Contact in this subpanel.
Most helpful comment
@pgorod Yes I understand your point that saving individual records for each email could be taxing on data storage and cause performance issues so that wouldn't actually be an option.
I do think some sort of workaround is needed though to both show the email in context for each person it has been sent to and to display the correct Contact(s) in the Account History sub-panel.
I have an idea at how this middle-ground might be achieved.
For displaying the correct Contacts' name in the Account History sub-panel, I think the only real solution would be to match all the Contacts that are related to the email with the Contacts related to the Account.
In the case of only one Contact being matched, that Contact's name can simply be displayed in the sub-panel. In the case of multiple Contacts being matched then a count of those Contacts be displayed in the sub-panel and those Contacts names can be viewed on click via a tool-tip or popup.
Alternatively to displaying the count of matching Contacts, the email could be displayed multiple times in the sub-panel, one for each Contact match. This would allow for only one name to be displayed for each row in the sub-panel.
In regards to viewing the email in context for specific recipients (i.e. Contacts, Accounts, Leads, Targets) I believe it could be added as a feature to the Emails module for Campaign emails. This could make use of the already existing sub-panels by adding an option/button to view the email for specific recipients with the default showing the email template variables (as it currently does). A request could then be made to retrieve the relevant information using the given id and parse the email variables and populate the 'to' address.
What are your thoughts on this?