Home How-to guides Configure Email

Configure Email

Last updated on Jun 12, 2026

This guide covers email notification setup and management.

SMTP Configuration

Access Email Settings

  1. Sign in as an admin
  2. Navigate to Settings > Email

Configure SMTP Server

Fill in your SMTP server details:

Field Description Common Values
SMTP Host Mail server address smtp.gmail.com, smtp-mail.outlook.com
SMTP Port Server port 587 (TLS), 465 (SSL), 25 (unencrypted)
Username Authentication email your-email@domain.com
Password SMTP password App-specific password recommended
From Email Sender address noreply@company.com
From Name Display name CHRIS HR System
Use TLS Enable encryption Yes (recommended)

Provider-Specific Setup

=== "Gmail"

1. Enable 2-factor authentication on your Google account
2. Create an [App Password](https://myaccount.google.com/apppasswords)
3. Use these settings:
    - Host: `smtp.gmail.com`
    - Port: `587`
    - TLS: Enabled
    - Username: Your Gmail address
    - Password: The 16-character app password

=== "Outlook/Microsoft 365"

1. Create an [App Password](https://account.live.com/proofs/AppPassword)
2. Use these settings:
    - Host: `smtp-mail.outlook.com`
    - Port: `587`
    - TLS: Enabled
    - Username: Your Outlook address
    - Password: The app password

=== "Custom SMTP"

Consult your email provider's documentation for:

- SMTP host address
- Required port
- Authentication method
- TLS/SSL requirements

Test Configuration

  1. Click Send Test Email
  2. A test email will be sent to your logged-in email address
  3. Check your inbox (and spam folder)
  4. If successful, you'll see a green confirmation

!!! failure "Test Failed?" Common issues:

- Wrong password (use app-specific password)
- Incorrect port for TLS setting
- Firewall blocking outbound SMTP
- Account requires additional verification

Email Templates

View Available Templates

Navigate to Settings > Email Templates:

Template Trigger Recipients
Leave Request Submitted New request created Team leaders, HR
Leave Request Approved Request approved Employee
Leave Request Rejected Request rejected Employee
Welcome Email New employee created New employee
Password Reset Password reset requested Employee

Edit a Template

  1. Click on a template to edit
  2. Modify the content:
    • Subject: Email subject line
    • Body: HTML email content
  3. Use placeholders for dynamic content
  4. Click Save

Available Placeholders

Use these in templates with double curly braces:

Placeholder Description
{{employee_name}} Full name of the employee
{{employee_email}} Employee's email address
{{leave_type}} Type of leave requested
{{start_date}} Leave start date
{{end_date}} Leave end date
{{working_days}} Number of working days
{{status}} Request status
{{approver_name}} Name of person who approved/rejected
{{comments}} Approver's comments

Example Template

<h2>Leave Request {{status}}</h2>
<p>Dear {{employee_name}},</p>
<p>Your leave request has been <strong>{{status}}</strong>.</p>
<ul>
  <li>Type: {{leave_type}}</li>
  <li>Dates: {{start_date}} - {{end_date}}</li>
  <li>Working Days: {{working_days}}</li>
</ul>
<p>Decision by: {{approver_name}}</p>
{{#if comments}}
<p>Comments: {{comments}}</p>
{{/if}}

Email Rerouting

Use email rerouting during testing to prevent sending to real users.

Enable Rerouting

  1. Go to Settings > Email
  2. Toggle Enable Email Rerouting to on
  3. Enter a Reroute Address (e.g., testing@yourcompany.com)
  4. Click Save

All notification emails will now go to the reroute address instead of actual recipients.

When to Use Rerouting

  • Initial system setup
  • Testing email templates
  • Staging environment
  • Training sessions

Disable for Production

!!! warning "Remember to Disable" Before going live, ensure email rerouting is disabled so notifications reach actual recipients.


Troubleshooting

Emails Not Sending

  1. Check SMTP credentials: Verify host, port, username, password
  2. Verify TLS setting: Some servers require TLS, others don't
  3. Check Edge Function logs: Supabase Dashboard > Functions > send-notification-email > Logs
  4. Test with minimal settings: Try with a simple SMTP provider first

Emails Going to Spam

  1. Ensure "From Email" matches your domain
  2. Set up SPF/DKIM records for your domain
  3. Avoid spam trigger words in subjects
  4. Use a reputable SMTP provider

Template Variables Not Replacing

  1. Check placeholder syntax: {{variable_name}}
  2. Verify the variable exists in the template context
  3. Check for typos in variable names

Rate Limiting

Some providers limit email frequency:

Provider Typical Limit
Gmail 500/day
Outlook 300/day
SendGrid Varies by plan

For high-volume needs, consider a dedicated email service like SendGrid, Mailgun, or Amazon SES.