Sha256: cc46ada384765e7d5e063a383cd58a56be82e966ffd0d08d08ef2830cf4e52d2

Contents?: true

Size: 889 Bytes

Versions: 3

Compression:

Stored size: 889 Bytes

Contents

module QuoVadis
  class Notifier < ActionMailer::Base

    # Sends an email to <tt>user</tt> with a link to a page where they
    # can change their password.
    def change_password(user)
      @username = user.username
      @url = change_password_url user.token
      mail :to => user.email, :from => QuoVadis.from, :subject => QuoVadis.subject_change_password
    end

    # Sends an email to <tt>user</tt> with a link to a page where they
    # can choose their username and password.
    #
    # `data` - hash of data to pass to view via instance variables.  A key of `:foo`
    #          will be available via `@foo`.
    def invite(user, data = {})
      @user = user
      @url = invitation_url user.token
      data.each { |k,v| instance_variable_set :"@#{k}", v }
      mail :to => user.email, :from => QuoVadis.from, :subject => QuoVadis.subject_invitation
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
quo_vadis-1.2.2 app/mailers/quo_vadis/notifier.rb
quo_vadis-1.2.1 app/mailers/quo_vadis/notifier.rb
quo_vadis-1.2.0 app/mailers/quo_vadis/notifier.rb