SendPulse SMTP — Plan

Complexity: Low Integration: SendPulse SMTP for transactional email delivery in production


External Setup

  1. Create SendPulse account at https://sendpulse.com/
  2. Settings → SMTP → Enable SMTP service
  3. Note SMTP credentials:
    • Host: smtp-pulse.com
    • Port: 587 (TLS)
    • Username: your SendPulse login email
    • Password: generated SMTP password (NOT account password)
  4. Verify sender domain in SendPulse: Settings → Domain Settings → add SPF, DKIM, DMARC DNS records
  5. Choose and verify sender email (e.g., [email protected])

Code Changes

  1. Add credentials via bin/rails credentials:edit:
    sendpulse:
      smtp_address: "smtp-pulse.com"
      smtp_port: 587
      smtp_username: "your-sendpulse-smtp-username"
      smtp_password: "your-sendpulse-smtp-password"
    
  2. Configure SMTP in config/environments/production.rb:
    config.action_mailer.delivery_method = :smtp
    config.action_mailer.smtp_settings = {
      address: Rails.application.credentials.dig(:sendpulse, :smtp_address) || "smtp-pulse.com",
      port: Rails.application.credentials.dig(:sendpulse, :smtp_port) || 587,
      user_name: Rails.application.credentials.dig(:sendpulse, :smtp_username),
      password: Rails.application.credentials.dig(:sendpulse, :smtp_password),
      authentication: "plain",
      enable_starttls_auto: true
    }
    
  3. Set default URL options:
    config.action_mailer.default_url_options = { host: ENV.fetch("APP_HOST", "example.com"), protocol: "https" }
    
  4. Update config.mailer_sender in config/initializers/devise.rb to verified sender email

Environment Variables

APP_HOST=yourdomain.com              # Used for ActionMailer URL generation
[email protected] # From address for system emails

DNS Records

Type Name Value Purpose
TXT @ SendPulse SPF record Email auth
TXT _dkim... SendPulse DKIM value Email signing
TXT _dmarc v=DMARC1; p=none DMARC policy

Verification

  • Trigger Devise password reset in production → email arrives via SendPulse
  • Check SendPulse dashboard for delivery logs
  • Test notification emails (Noticed system)