Sha256: 357fbe648a59ac011021a252015579a6f8ff9c455dcec99a22fa6b4c2271d029

Contents?: true

Size: 1019 Bytes

Versions: 1

Compression:

Stored size: 1019 Bytes

Contents

require 'peoplefinder'

class Peoplefinder::UserUpdateMailer < ActionMailer::Base
  def new_profile_email(person, by_email = nil)
    @person = person
    @by_email = by_email
    set_token_params
    mail to: @person.email
  end

  def updated_profile_email(person, by_email = nil)
    @person = person
    @by_email = by_email
    set_token_params
    mail to: @person.email
  end

  def deleted_profile_email(person, by_email = nil)
    @person = person
    @by_email = by_email
    mail to: @person.email
  end

  def updated_address_from_email(person, by_email, old_email)
    @person = person
    @by_email = by_email
    set_token_params
    mail to: old_email
  end

  def updated_address_to_email(person, by_email, _old_email)
    @person = person
    @by_email = by_email
    set_token_params
    mail to: @person.email
  end

private

  def set_token_params
    @token_params = {
      id: Peoplefinder::Token.for_person(@person).to_param,
      desired_path: "/people/#{ @person.to_param }"
    }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
peoplefinder-0.0.2 app/mailers/peoplefinder/user_update_mailer.rb