Skip to main content
EaseLMS includes a comprehensive email notification system powered by SendGrid that keeps learners and admins informed about important events.

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
All emails are:
  • 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:
1

Create SendGrid account

Sign up for a free account at sendgrid.com. The free tier includes 100 emails per day.
2

Verify sender identity

In SendGrid dashboard:
  • Go to Settings → Sender Authentication
  • Verify your email address or domain
  • Complete sender verification (required to send emails)
3

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!)
4

Configure environment variables

Add SendGrid credentials to your .env.local file:
SENDGRID_API_KEY=SG.xxxxxxxxxxxxxxx
SENDGRID_FROM_EMAIL=noreply@yourdomain.com
SENDGRID_FROM_NAME=Your Platform Name
SENDGRID_REPLY_TO=support@yourdomain.com
Keep your SendGrid API key secure. Never commit it to version control or share it publicly.

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
Emails adapt to light and dark mode based on recipient preferences.

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:
  1. Header - Platform logo and branding
  2. Greeting - Personalized salutation
  3. Main content - Event-specific information
  4. Call-to-action - Prominent button (e.g., “Access Course”)
  5. Additional details - Supporting information
  6. Footer - Contact info, links, and legal text

Configuration options

Platform settings

Control notification behavior in Settings → Platform:
1

Course enrollment notifications

Toggle whether enrollment confirmation emails are sent to learners.
2

Course completion notifications

Enable/disable course completion congratulations emails.
3

Platform announcements

Allow platform-wide announcement emails to all users.
4

User email notifications (default)

Set the default email preference for new user accounts. Users can change this in their profile.

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
Update brand settings to immediately affect all future emails. Test emails by triggering actions (like enrollments) to verify branding.

Email delivery

Sending process

1

Event triggered

An action occurs (enrollment, payment, completion, etc.).
2

Email queued

EaseLMS prepares the email with relevant data and branding.
3

SendGrid processes

Email is sent to SendGrid API for delivery.
4

Delivery confirmed

SendGrid delivers the email and returns confirmation.

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:
1

Configure test email

Use your personal email as the SENDGRID_FROM_EMAIL during development.
2

Trigger test events

  • Sign up a test account
  • Enroll in a course
  • Complete a course
  • Make a test payment
3

Verify email delivery

Check your inbox for emails and verify:
  • Emails arrive promptly
  • Branding appears correctly
  • Links work properly
  • Content is accurate

Email preview

Verify email content:
  1. Check SendGrid Activity Feed to see sent emails
  2. Preview email HTML in browser
  3. Test on different email clients (Gmail, Outlook, Apple Mail)
  4. 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
SendGrid’s free tier allows 100 emails/day. For platforms with more users, upgrade to a paid plan with higher sending limits.

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
If emails consistently fail to send, check your SendGrid account status and daily sending limits.

Advanced configuration

Custom templates

While EaseLMS includes default templates, you can customize them:
  1. Modify email templates in /lib/email/email-templates.ts
  2. Update email HTML and text versions
  3. Maintain responsive design
  4. 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.