Is it possible to send email with multiple object information such as we have connection between contact and account object so we want to send email via template using some fields from account object and some from contact object? Thank you
1 Answer
Yes you can. If you need complex logic that pull information from several objects you can create visualforce email template and inside use visualforce component. The visualforce Component can have apex controller that will retrieve all the relevant data that you need.
-
So I need to include custom coding for that? Is it possible through standard email templates? Commented Sep 3, 2020 at 11:44
-
1With the basic emails template you might be able to use data that have relation.If your email related to contact, then you can access contact merge fields, Account fields (for example {!Contact.Account.Type}) and also related list for the contact, but if you need more complex logic then yes you will need to write code.– Liron CCommented Sep 3, 2020 at 11:50
-
1If it's not a huge amount of fields, you could also create formulas field on the Contact (or any child) object referencing the required fields from the Account (or any parent) object that can be referenced in the email template– InstreadCommented Sep 3, 2020 at 12:43