Salesforce Admin – Email Alerts & Templates Questions
Email communication is a vital part of Salesforce automation and user engagement. These questions cover email template types, merge fields, email alerts vs. actions, Apex email sending, troubleshooting techniques, mass email limitations, file attachments, conditional logic, testing strategies, organization-wide email addresses, welcome email automation, email tracking, and integration with external systems. Understanding email functionality is essential for effective communication in Salesforce.
Email Alerts & Templates - Q&A
- Q1. What are the types of email templates in Salesforce, and when would you use each?
Ans:
- Text: Simple plain-text emails (e.g., system notifications).
- HTML (Custom): Branded templates with formatting (e.g., marketing emails).
- Visualforce: Dynamic content with Apex logic (e.g., invoices, conditional data).
- Letterhead: Reusable headers/footers for other templates. - Q2. How do you personalize an email template using merge fields?
Ans: Use {!Object.Field} syntax (e.g.,{!Contact.Name}
). Merge fields pull data from the record triggering the email (e.g., workflow, flow, or Apex). - Q3. What's the difference between Email Alerts and Email Actions?
Ans:
- Email Alerts: Triggered by workflows/processes; sent to predefined recipients.
- Email Actions: Used in Approval Processes or Flows; allow dynamic recipient selection. - Q4. Can you send an email template via Apex? Give an example.
Ans: Yes! Example:
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); email.setTemplateId([SELECT Id FROM EmailTemplate WHERE DeveloperName = 'Welcome_Email'].Id); email.setTargetObjectId(contactId); // Required for templates Messaging.sendEmail(new List
{email}); - Q5. How would you troubleshoot an email not being sent from Salesforce?
Ans: Check:
- Email Deliverability (Setup → "Email Deliverability" set to "All Email").
- Recipient's Email Address (valid and not private in their profile).
- Debug Logs (for Apex-sent emails).
- Activity History (if the email was saved as an activity). - Q6. What are Mass Email limitations in Salesforce?
Ans:
- Standard objects: 500/day per org (can request increase).
- Custom objects: 1,000/day per org.
- Recipient limits: 5,000 per mass email.
- Requires "Mass Email" permission. - Q7. How do you attach files to an email template dynamically?
Ans: Options:
- Content Document Links: Attach files from Salesforce Libraries.
- Apex: UsesetEntityAttachments()
to attach records (e.g., Quotes).
- Visualforce Template: Embed files as PDF attachments. - Q8. Can you use conditional logic in email templates?
Ans: Only in Visualforce Templates (using Apex controllers). HTML/Text templates support basic merge fields but not IF conditions. - Q9. How do you test email templates before deployment?
Ans:
1. Use Preview with a sample record.
2. Send test emails via Apex (in Sandbox).
3. Deploy to Sandbox first and validate with real users. - Q10. What are Organization-Wide Email Addresses, and why use them?
Ans: They allow sending emails from a shared domain (e.g.,support@company.com
). Benefits:
- Avoids "no-reply@salesforce.com" as sender.
- Requires domain verification in Setup. - Q11. How would you automate a welcome email for new Contacts?
Ans: Options:
- Process Builder/Flow: Trigger an email alert on Contact creation.
- Apex Trigger: For complex logic (e.g., validate data before sending). - Q12. Can you track email opens/clicks in Salesforce?
Ans: Yes, with Email Tracking (for Lightning Email) or Marketing Cloud for advanced analytics. Native Salesforce only tracks sends/bounces.