Sha256: 56a0c480ef1616f044b17ec28b6016a3c0193ed656c8b18931c710577d424149

Contents?: true

Size: 992 Bytes

Versions: 13

Compression:

Stored size: 992 Bytes

Contents

class UserMailer < ActionMailer::Base
  def signup_notification(user, activation_url)
    setup_email(user)
    @body[:user] = user
    @subject    += 'Please activate your new account'
    @body[:url]  = activation_url
  end
  
  def activation(user, home_url)
    setup_email(user)
    @body[:user] = user
    @subject    += 'Your account has been activated!'
    @body[:url]  = home_url
  end

  def recap(users, subject, content, home_url)
    setup_email(users[0])
    @recipients = ADMIN_EMAIL
    @bcc = users.map{|u| u.email}
    @subject << subject
    @body[:content] = content
    @body[:url] = home_url
  end

  def password_reset_notification(user, reset_url)
    setup_email(user)
    @subject    = 'Link to reset your password'
    @body[:url]  = reset_url
   end
  
  protected
    def setup_email(user)
      @user = user
      @recipients  = user.email
      @from        = ADMIN_EMAIL
      @subject     = "[#{TOURNAMENT_TITLE}] "
      @sent_on     = Time.now
    end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
tournament-5.0.0 webgui/app/models/user_mailer.rb
tournament-4.2.0 webgui/app/models/user_mailer.rb
tournament-4.0.2 webgui/app/models/user_mailer.rb
tournament-4.0.0 webgui/app/models/user_mailer.rb
tournament-3.3.3 webgui/app/models/user_mailer.rb
tournament-3.3.2 webgui/app/models/user_mailer.rb
tournament-3.3.1 webgui/app/models/user_mailer.rb
tournament-3.3.0 webgui/app/models/user_mailer.rb
tournament-3.2.2 webgui/app/models/user_mailer.rb
tournament-3.2.1 webgui/app/models/user_mailer.rb
tournament-3.2.0 webgui/app/models/user_mailer.rb
tournament-3.1.1 webgui/app/models/user_mailer.rb
tournament-3.1.0 webgui/app/models/user_mailer.rb