Sha256: a62de39183b61f4c59df2bdcb102caa42acce25eb2a56a4c69621eea0719d1b8

Contents?: true

Size: 722 Bytes

Versions: 46

Compression:

Stored size: 722 Bytes

Contents

require 'roadie-rails'

class RadSocialMailer < ApplicationMailer
  include Roadie::Rails::Automatic

  def social_mail(options)
    from_address = Mail::Address.new options[:from] # ex: "john@example.com"
    from_address.display_name = options[:from_name] # ex: "John Doe"

    @from_name = from_address.display_name
    @from_email = from_address
    @message = options[:message]
    @actual_from = ENV.fetch('RAD_SOCIAL_FROM_EMAIL')
    @actual_from = from_address if @actual_from.nil?

    mail({
           to: options[:to],
           from: @actual_from,
           reply_to: @from_email,
           subject: options[:subject],
           text: @message,
           content_type: 'text/html',
         })
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
trusty-cms-6.0.5 app/mailers/rad_social_mailer.rb
trusty-cms-6.0.4 app/mailers/rad_social_mailer.rb
trusty-cms-6.0.3 app/mailers/rad_social_mailer.rb
trusty-cms-6.0.2 app/mailers/rad_social_mailer.rb
trusty-cms-6.0.1 app/mailers/rad_social_mailer.rb
trusty-cms-5.6.1 app/mailers/rad_social_mailer.rb
trusty-cms-6.0.0 app/mailers/rad_social_mailer.rb
trusty-cms-5.6.0 app/mailers/rad_social_mailer.rb
trusty-cms-5.5.9 app/mailers/rad_social_mailer.rb
trusty-cms-5.5.8 app/mailers/rad_social_mailer.rb
trusty-cms-5.5.7 app/mailers/rad_social_mailer.rb
trusty-cms-5.5.6 app/mailers/rad_social_mailer.rb
trusty-cms-5.5.5.1 app/mailers/rad_social_mailer.rb
trusty-cms-5.5.1 app/mailers/rad_social_mailer.rb
trusty-cms-5.5 app/mailers/rad_social_mailer.rb
trusty-cms-5.4.4 app/mailers/rad_social_mailer.rb
trusty-cms-5.4.3 app/mailers/rad_social_mailer.rb
trusty-cms-5.4.2 app/mailers/rad_social_mailer.rb
trusty-cms-5.4.1 app/mailers/rad_social_mailer.rb
trusty-cms-5.4.0 app/mailers/rad_social_mailer.rb