saucy/app/mailers/notification_mailer.rb

59 lines
1.2 KiB
Ruby

class NotificationMailer < ApplicationMailer
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.notification_mailer.expiration_in_60d.subject
#
def expiration_in_60d
set_notification
mail to: @notification.member.email
end
def expiration_in_30d
set_notification
mail to: @notification.member.email
end
def expired
set_notification
mail to: @notification.member.email
end
def expired_30d_ago
set_notification
mail to: @notification.member.email
end
def expired_60d_ago
set_notification
mail to: @notification.member.email
end
def cancelled
set_notification
mail to: @notification.member.email
end
def registration
@member = params[:member]
@payment = @member.create_payment
mail to: @member.email
end
def first_payment_confirmation
@contribution = params[:contribution]
mail to: @contribution.member.email
end
def payment_renewal_confirmation
@contribution = params[:contribution]
mail to: @contribution.member.email
end
private
def set_notification
@notification = params[:notification]
@payment = @notification.member.create_payment
end
end