test

Ruby code posted by test
created at 25 Dec 11:57, updated at 27 Dec 07:51

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class ForgotPasswordMailer < ActionMailer::Base
  
  def forgot_password(password, _somethine)
    setup_email(password.user)
    @subject    += 'You have requested to change your password'
    @body[:url]  = "http://sciibzsv01.greatsimplex.com#{ENV['RAILS_URL_ROOT']}/change_password/#{password.reset_code}"
  end

  def reset_password(user, password)
    setup_email(user)
    @body[:password] = password
    @subject    += 'Your password has been reset.'
  end

  protected
    def setup_email(user)
      @recipients  = "#{user.email}"
      @from        = "sanjose-mgmt@simplex-cn.co.jp"
      @subject     = "[HORUS] "
      @sent_on     = Time.now
      @body[:user] = user
    end
end
714 Bytes in 5 ms with coderay