You need to sign in to do that
Don't have an account?
Michela Bovio
EmailTemplateId field not always populated in the EMailMessage object
I'm trying to find who is the last user that used a classc email template in an email and I found that in the EmailMessage object there is the EmailTemplateId field that could help me
Looking at the EmailMessage object I find too few records having this field populated even if I know that in our org many users use email templates.
also read that that field is populated just if Lightning is enabled but our org is still in Classic so how is that possible ?
Any help on thi is appreciated
Thanks
Michela
Looking at the EmailMessage object I find too few records having this field populated even if I know that in our org many users use email templates.
also read that that field is populated just if Lightning is enabled but our org is still in Classic so how is that possible ?
Any help on thi is appreciated
Thanks
Michela
As per the documentation https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_emailmessage.htm EmailTemplateId is populated in Lightning Experience only.
Does any of your users have Lightning Experience User permission?
What does UserInfo.UIThemeDisplayed() return for the user returned from your analysis?
It could be possible that EmailTemplateId is populated through Apex. Can you try inserting an EmailMessage with emailTemplateId, that should help confirm the behavior
A similar discussion has happened here:
https://salesforce.stackexchange.com/questions/285670/emailmessage-object-emailtemplateid-is-null
If this answers your question, please mark this as Best Answer so that it can help others in the future. Thank You!
thanks for your quick answer
We still didn't enable lightning for our users, just a few of us use lightning. None of the users that sent the emails having the EmailTemplateId field populated is using Lightning interface
We also don't use APEX for sending emails with templates
So I really don't understand why the EmailTemplateId is present on some email message
Michela
Can you check if the template found using EmailTemplateId field is a default email template? Default email templates are generally used when send email quick action is used but again that looks like it is only available in LEX
https://help.salesforce.com/articleView?id=case_interaction_send_email_quick_action_default_email_template_lex.htm&type=5
Anudeep
Thanks for looking at this, I just checked and I found that it isn't a default email template
Michela
This looks strange. Can you try engaging Salesforce Support to investigate further? Thanks
Anudeep