Sha256: 4bd22114f2fd84ddd54d7f49bbf030765c1f0da6d0037038d3303eede7c9fbf4

Contents?: true

Size: 886 Bytes

Versions: 20

Compression:

Stored size: 886 Bytes

Contents

module Cmor::Contact
  class ContactRequestMailer < ApplicationMailer

    # Subject can be set in your I18n file at config/locales/en.yml
    # with the following lookup:
    #
    #   en.contact_request_mailer.notify.subject
    #
    def notify(contact_request)
      @contact_request = contact_request

      mail to: notification_recipients,
           from: notification_sender(contact_request),
           subject: notification_subject
    end

    private

    def notification_subject
      default_i18n_subject(application_name: Rails.application.class.to_s.split('::').first.underscore.humanize.titleize)
    end

    def notification_sender(contact_request)
      "#{contact_request.name} <#{contact_request.email}>"
    end

    def notification_recipients
      ENV.fetch('CMOR_CONTACT_RECIPIENTS') { Cmor::Contact::Configuration.recipients[Rails.env] }
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
cmor_contact-0.0.21.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.20.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.19.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.18.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.17.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.15.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.14.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.13.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.12.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.11.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.10.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.9.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.8.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.7.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.6.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.5.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.4.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.3.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.2.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.1.pre app/mailers/cmor/contact/contact_request_mailer.rb