Send Intro Email When New Lead Is Created
Business Requirement:
When a new Lead is created, automatically send a personalized introductory email to the lead — welcoming them and introducing the company.
Why?
- Sales reps often forget to send intro emails
- Helps build instant trust
- Looks professional and saves time
Business Value:
- ✔ Builds trust instantly
- ✔ Saves time for sales reps
- ✔ Makes the company look professional
Used:
- Lead (Standard Object)
- Messaging.SingleEmailMessage (for sending emails)
Apex Trigger Code:
trigger SendWelcomeEmail on Lead (after insert) {
List<Messaging.SingleEmailMessage> emails = new List<Messaging.SingleEmailMessage>();
for (Lead l : Trigger.new) {
if (l.Email != null) {
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setToAddresses(new String[] { l.Email });
mail.setSubject('Thanks for contacting us, ' + l.FirstName);
mail.setPlainTextBody('Hi ' + l.FirstName + ',\n\nThanks for showing interest in our services. Our team will get in touch with you shortly.\n\nRegards,\nSales Team');
emails.add(mail);
}
}
if (!emails.isEmpty()) {
Messaging.sendEmail(emails);
}
}
Example Email Sent:
Subject: Thanks for contacting us, Ritesh
Hi Ritesh,
Thanks for showing interest in our services. Our team will get in touch with you shortly.
Regards,
Sales Team
Real-Time Use Cases:
- Real Estate: Auto-greet property inquiries
- Consulting: Welcome new client leads
- SaaS: Trial user greetings
- Finance: Investor form auto-response
Note:
- Ensure Email Deliverability is enabled (Setup → Email Deliverability)
- Use HTML Email Templates for better design