Sha256: 8aa5286f54328763ceddb6e8917f502870b775b6d3878bac17c9a862c8b96fb3

Contents?: true

Size: 671 Bytes

Versions: 10

Compression:

Stored size: 671 Bytes

Contents

module InfinumId
  class Mailer < InfinumId::ApplicationMailer
    before_action :load_params

    def welcome_email
      mail(to: @resource.email, subject: "Welcome to #{@service_name}")
    end

    def invite_email
      @accept_path = params[:accept_path]

      mail(to: @resource.email, subject: "Invite to #{@service_name}")
    end

    def load_params
      @resource = resource_class.find(params[:resource_id])
      @invited_by = resource_class.find_by(uid: params[:invited_by_uid])
      @service_name = InfinumId.service_name
      @service_url = Rails.configuration.host_url
    end

      delegate :resource_name, :resource_class, to: InfinumId
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
infinum_id-2.2.0 app/mailers/infinum_id/mailer.rb
infinum_id-2.1.0 app/mailers/infinum_id/mailer.rb
infinum_id-2.0.1 app/mailers/infinum_id/mailer.rb
infinum_id-2.0.0 app/mailers/infinum_id/mailer.rb
infinum_id-1.6.0 app/mailers/infinum_id/mailer.rb
infinum_id-1.5.1 app/mailers/infinum_id/mailer.rb
infinum_id-1.5.0 app/mailers/infinum_id/mailer.rb
infinum_id-1.4.2 app/mailers/infinum_id/mailer.rb
infinum_id-1.4.1 app/mailers/infinum_id/mailer.rb
infinum_id-1.4.0 app/mailers/infinum_id/mailer.rb