Sha256: f8634e6b7723128858f18aa465431d440c6f15beed5b95ace84eee4367153095

Contents?: true

Size: 769 Bytes

Versions: 12

Compression:

Stored size: 769 Bytes

Contents

module Rodauth
  module Rails
    module Feature
      module Email
        extend ActiveSupport::Concern

        included do
          depends :email_base
        end

        private

        # Create emails with ActionMailer which uses configured delivery method.
        def create_email_to(to, subject, body)
          Mailer.create_email(to: to, from: email_from, subject: "#{email_subject_prefix}#{subject}", body: body)
        end

        # Delivers the given email.
        def send_email(email)
          email.deliver_now
        end

        # ActionMailer subclass for correct email delivering.
        class Mailer < ActionMailer::Base
          def create_email(options)
            mail(options)
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rodauth-rails-2.0.0 lib/rodauth/rails/feature/email.rb
rodauth-rails-1.15.2 lib/rodauth/rails/feature/email.rb
rodauth-rails-1.15.1 lib/rodauth/rails/feature/email.rb
rodauth-rails-1.15.0 lib/rodauth/rails/feature/email.rb
rodauth-rails-1.14.0 lib/rodauth/rails/feature/email.rb
rodauth-rails-1.13.0 lib/rodauth/rails/feature/email.rb
rodauth-rails-1.12.0 lib/rodauth/rails/feature/email.rb
rodauth-rails-1.11.0 lib/rodauth/rails/feature/email.rb
rodauth-rails-1.10.0 lib/rodauth/rails/feature/email.rb
rodauth-rails-1.9.0 lib/rodauth/rails/feature/email.rb
rodauth-rails-1.8.0 lib/rodauth/rails/feature/email.rb
rodauth-rails-1.7.1 lib/rodauth/rails/feature/email.rb