class Suspenders::Production::EmailGenerator

Public Instance Methods

env_vars() click to toggle source
# File lib/suspenders/generators/production/email_generator.rb, line 21
def env_vars
  expand_json(
    "app.json",
    env: {
      SMTP_ADDRESS: {required: true},
      SMTP_DOMAIN: {required: true},
      SMTP_PASSWORD: {required: true},
      SMTP_USERNAME: {required: true}
    }
  )
end
smtp_configuration() click to toggle source
# File lib/suspenders/generators/production/email_generator.rb, line 6
def smtp_configuration
  copy_file "smtp.rb", "config/smtp.rb"

  prepend_file "config/environments/production.rb",
    %{require Rails.root.join("config/smtp")\n}
end
use_smtp() click to toggle source
# File lib/suspenders/generators/production/email_generator.rb, line 13
def use_smtp
  inject_template_into_file(
    "config/environments/production.rb",
    "partials/email_smtp.rb",
    after: "config.action_mailer.perform_caching = false"
  )
end