Sha256: b7b18ea89b94ec009cb64c79817942312a866a5329fcae84837ffb76df72307f

Contents?: true

Size: 474 Bytes

Versions: 61

Compression:

Stored size: 474 Bytes

Contents

class GeneralMailer < ActionMailer::Base
  def email(email)
    mail(headers(email)) do |format|
      format.text { render text: email.plain_content }
      format.html { render html: email.html_content.html_safe }
    end

    email.mark_as_sent!
  end

  private

  def headers(email)
    from = "#{email.from_name} <#{email.from_email}>"
    to = "#{email.to_name} <#{email.to_email}>"

    {
      from: from,
      to: to,
      subject: email.subject
    }
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
udongo-7.9.0 app/mailers/general_mailer.rb
udongo-7.8.1 app/mailers/general_mailer.rb
udongo-7.8.0 app/mailers/general_mailer.rb
udongo-7.7.2 app/mailers/general_mailer.rb
udongo-7.7.1 app/mailers/general_mailer.rb
udongo-7.7.0 app/mailers/general_mailer.rb
udongo-7.6.2 app/mailers/general_mailer.rb
udongo-7.6.1 app/mailers/general_mailer.rb
udongo-7.6.0 app/mailers/general_mailer.rb
udongo-7.5.1 app/mailers/general_mailer.rb
udongo-7.5.0 app/mailers/general_mailer.rb
udongo-7.4.2 app/mailers/general_mailer.rb
udongo-7.4.1 app/mailers/general_mailer.rb
udongo-7.4.0 app/mailers/general_mailer.rb
udongo-7.3.5 app/mailers/general_mailer.rb
udongo-7.3.4 app/mailers/general_mailer.rb
udongo-7.3.3 app/mailers/general_mailer.rb
udongo-7.3.2 app/mailers/general_mailer.rb
udongo-7.3.1 app/mailers/general_mailer.rb
udongo-7.2.1 app/mailers/general_mailer.rb