APP

Documentation

Developer Guide

Email System

AutoTechJobs uses the Resend email service for all email communications, providing a reliable and scalable solution for transactional emails and notifications.

Email Infrastructure

Core Components

  • EmailService - Main email service class
  • NotificationService - Handles notifications
  • EmailTemplateService - Manages email templates

Email Types

  • Transactional emails
  • Job application notifications
  • User registration
  • Password reset
  • Job alerts
  • System notifications

Email Templates

Template Structure

  • HTML templates with Handlebars syntax
  • Dynamic content injection
  • Custom CSS styling
  • Responsive design

Template Variables

  • &{&{user.name&}&} - User name
  • &{&{job.title&}&} - Job title
  • &{&{company.name&}&} - Company name
  • &{&{verificationUrl&}&} - Verification URLs

Email Service Implementation

// In services/email.service.ts
import { Resend } from "resend";
import { EmailTemplateService } from "./email-template.service";

export class EmailService {
  private resend: Resend;
  private templateService: EmailTemplateService;

  constructor() {
    this.resend = new Resend(process.env.RESEND_API_KEY);
    this.templateService = new EmailTemplateService();
  }

  async sendJobApplicationNotification(data: JobApplicationData) {
    const template = await this.templateService.getTemplate("job-application");
    const html = this.templateService.render(template, data);
    
    return this.resend.emails.send({
      from: "AutoTechJobs <[email protected]>",
      to: [data.recipientEmail],
      subject: "New Job Application Received",
      html,
    });
  }

  // ... other email methods
}

Best Practices

  • Always use template variables instead of string concatenation
  • Implement proper error handling for email failures
  • Use batch sending for large email operations
  • Track email delivery status
  • Implement rate limiting for bulk operations

For more information about email configuration and templates, see theConfigurationdocumentation.