Sha256: 2d47ab70379a135f7bc579829e85643ffdd616eed43c78348e6ebf2e248e3840

Contents?: true

Size: 872 Bytes

Versions: 7

Compression:

Stored size: 872 Bytes

Contents

module Pageflow
  class UserMailer < ActionMailer::Base
    include Resque::Mailer

    def invitation(options)
      # Different versions of resque_mailer either pass:
      #
      # - Hash with string keys (<= 2.4.0)
      # - Hash with symbol keys (2.4.1)
      # - Hash with both string and symbol keys (2.4.2)
      # - HashWithIndifferentAccess (2.4.3)
      #
      # Symbolize keys to support 2.4.1, but do not use bang version
      # (i.e. `smbolize_keys!`) since that is not supported by
      # HashWithIndifferentAccess.
      options = options.symbolize_keys

      @user = User.find(options[:user_id])
      @password_token = options[:password_token]

      I18n.with_locale(@user.locale) do
        headers('X-Language' => I18n.locale)
        mail(to: @user.email, subject: t('.subject'), from: Pageflow.config.mailer_sender)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pageflow-12.6.0 app/mailers/pageflow/user_mailer.rb
pageflow-12.5.0 app/mailers/pageflow/user_mailer.rb
pageflow-12.4.1 app/mailers/pageflow/user_mailer.rb
pageflow-12.4.0 app/mailers/pageflow/user_mailer.rb
pageflow-12.3.0 app/mailers/pageflow/user_mailer.rb
pageflow-12.2.0 app/mailers/pageflow/user_mailer.rb
pageflow-12.1.0 app/mailers/pageflow/user_mailer.rb