Sha256: 73be9b8da60abad0f43b518318689e4096a1be1872c9c32b09354679cad62f84

Contents?: true

Size: 836 Bytes

Versions: 2

Compression:

Stored size: 836 Bytes

Contents

require_relative "../base"

module Suspenders
  module Production
    class EmailGenerator < Generators::Base
      def smtp_configuration
        copy_file "smtp.rb", "config/smtp.rb"

        prepend_file "config/environments/production.rb",
          %{require Rails.root.join("config/smtp")\n}
      end

      def use_smtp
        inject_template_into_file(
          "config/environments/production.rb",
          "partials/email_smtp.rb",
          after: "config.action_mailer.perform_caching = false"
        )
      end

      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
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
suspenders-1.55.1 lib/suspenders/generators/production/email_generator.rb
suspenders-1.55.0 lib/suspenders/generators/production/email_generator.rb