Overview
The email notification system automatically sends professional, branded emails for:- User events - Enrollments, completions, certificates, payments
- Admin notifications - New enrollments, payments, course completions
- System emails - Welcome messages, password resets, confirmations
- Branded - Use your platform name and logo
- Responsive - Look great on all devices
- Professional - Clean, modern design
- Customizable - Adapt to your platform settings
SendGrid setup
Configure SendGrid to enable email notifications:Create SendGrid account
Sign up for a free account at sendgrid.com. The free tier includes 100 emails per day.
Verify sender identity
In SendGrid dashboard:
- Go to Settings → Sender Authentication
- Verify your email address or domain
- Complete sender verification (required to send emails)
Generate API key
Create an API key:
- Navigate to Settings → API Keys
- Click “Create API Key”
- Select “Full Access” or “Restricted Access” with Mail Send permissions
- Copy your API key (shown only once!)
Email types
User emails
Emails sent directly to learners:Welcome email
Sent when a new user signs up.Includes:
- Personalized greeting
- Platform introduction
- Getting started tips
- Dashboard link
Enrollment confirmation
Sent when a user enrolls in a course.Includes:
- Course name and description
- Enrollment date
- Course access link
- Getting started instructions
Course completion
Sent when a user completes a course.Includes:
- Congratulations message
- Course name
- Completion date
- Certificate link (if available)
Certificate ready
Sent when a certificate is generated.Includes:
- Certificate number
- Download link
- Course details
- Sharing instructions
Payment confirmation
Sent after successful payment.Includes:
- Transaction ID and amount
- Course access information
- Receipt/invoice
- Support contact
Payment failed
Sent when payment processing fails.Includes:
- Failure reason
- Retry instructions
- Alternative payment options
- Support contact
Admin emails
Notifications sent to platform administrators:New enrollment
Notifies admins of new course enrollments.Includes user name, email, course title, and enrollment date.
New payment
Notifies admins of successful payments.Includes transaction details, amount, user info, and course.
Course completion
Notifies admins when users complete courses.Includes user name, course title, and completion date.
Admin emails are sent to the contact email configured in Settings → Brand.
Email content
Branded templates
All emails automatically include your platform branding:- Platform name - From Settings → Brand
- Platform logo - Header logo (light/dark mode support)
- Contact email - Footer contact information
- App URL - Links back to your platform
Personalization
Emails include personalized content:- Recipient name - “Hi, John” greeting
- Course details - Specific course information
- Transaction data - Payment amounts and IDs
- Dates - Formatted enrollment/completion dates
Email structure
Each email follows a consistent structure:- Header - Platform logo and branding
- Greeting - Personalized salutation
- Main content - Event-specific information
- Call-to-action - Prominent button (e.g., “Access Course”)
- Additional details - Supporting information
- Footer - Contact info, links, and legal text
Configuration options
Platform settings
Control notification behavior in Settings → Platform:Brand settings
Configure email branding in Settings → Brand:- Platform name - Appears in email subject lines and headers
- Logo (dark) - Used in email headers for light mode
- Logo (light) - Used in email headers for dark mode
- Contact email - Displayed in email footers
- App URL - Base URL for links in emails
Email delivery
Sending process
Delivery time
Emails are typically delivered:- Instantly - Most emails sent within seconds
- SendGrid queue - May take 1-5 minutes during high volume
- Recipient server - Final delivery depends on recipient’s email provider
Tracking
SendGrid provides delivery tracking:- Activity Feed - View all sent emails in SendGrid dashboard
- Delivery status - See delivered, bounced, or failed emails
- Open rates - Track if recipients open emails (optional)
- Click tracking - Monitor link clicks (optional)
Testing emails
Test mode
Before going live, test email delivery:Trigger test events
- Sign up a test account
- Enroll in a course
- Complete a course
- Make a test payment
Email preview
Verify email content:- Check SendGrid Activity Feed to see sent emails
- Preview email HTML in browser
- Test on different email clients (Gmail, Outlook, Apple Mail)
- Verify mobile responsiveness
Send test emails to multiple email providers to ensure compatibility and good deliverability.
Best practices
Deliverability
- Verify sender domain - Use SendGrid domain authentication for better deliverability
- Warm up your domain - Start with small volumes and gradually increase
- Avoid spam triggers - Don’t use all caps, excessive exclamation marks, or spam keywords
- Provide unsubscribe - Include clear unsubscribe options (already built-in)
Content
- Clear subject lines - Make the email purpose immediately clear
- Concise content - Keep emails focused and scannable
- Strong CTAs - Use clear, action-oriented buttons
- Mobile-first - Ensure emails look good on mobile devices
Branding
- Consistent visuals - Use the same logo and colors across all emails
- Professional tone - Maintain a consistent voice
- Contact information - Always include support contact
- Legal compliance - Include required legal text and privacy policy links
Performance
- Monitor sending limits - Track your SendGrid usage
- Handle failures gracefully - Log failed sends and retry if needed
- Respect preferences - Honor user email preferences
- Avoid over-emailing - Don’t overwhelm users with too many emails
Troubleshooting
Emails not sending
Check:- SendGrid API key is correctly configured
- API key has Mail Send permissions
- Sender email is verified in SendGrid
- No SendGrid account restrictions or suspensions
- Server logs for error messages
Emails going to spam
Solutions:- Complete SendGrid domain authentication
- Avoid spam trigger words in subject/content
- Ensure unsubscribe link is present
- Build sender reputation gradually
- Ask recipients to whitelist your sender address
Branding not appearing
Check:- Platform settings are saved correctly
- Logo URLs are accessible (not blocked)
- Image formats are supported (PNG, JPG)
- Brand settings cache is cleared (restart server)
Wrong content in emails
Verify:- Correct data is passed to email templates
- Environment variables are up to date
- No caching issues with email templates
- User and course data is accurate in database
Advanced configuration
Custom templates
While EaseLMS includes default templates, you can customize them:- Modify email templates in
/lib/email/email-templates.ts - Update email HTML and text versions
- Maintain responsive design
- Test thoroughly before deploying
Webhook integration
SendGrid webhooks provide real-time delivery updates:- Configure webhook endpoint in SendGrid dashboard
- Receive delivery, bounce, and open notifications
- Log email events for analytics
- Handle bounces and unsubscribes automatically
Localization
Support multiple languages:- Detect user language preference
- Load appropriate email template
- Translate email content
- Maintain separate templates per language
Multi-language email support requires custom development. The default system sends emails in English.