Sha256: 6b66d05c09cc6d3f8cac45fcaccaf654daa40c2024c07d280c165b16d97941dd

Contents?: true

Size: 891 Bytes

Versions: 20

Compression:

Stored size: 891 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.call(Rails.env) }
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
cmor_contact-0.0.42.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.41.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.40.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.39.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.38.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.37.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.36.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.35.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.34.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.33.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.32.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.31.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.30.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.29.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.28.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.27.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.26.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.25.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.24.pre app/mailers/cmor/contact/contact_request_mailer.rb
cmor_contact-0.0.22.pre app/mailers/cmor/contact/contact_request_mailer.rb