saucy/app/mailers/notification_mailer.rb

59 lines
1.2 KiB
Ruby
Raw Normal View History

2022-06-25 12:48:46 +00:00
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
2023-08-07 12:50:50 +00:00
set_notification
2022-07-16 10:27:43 +00:00
mail to: @notification.member.email
2022-06-25 12:48:46 +00:00
end
def expiration_in_30d
2023-08-07 12:50:50 +00:00
set_notification
2022-07-16 10:27:43 +00:00
mail to: @notification.member.email
2022-06-25 12:48:46 +00:00
end
def expired
2023-08-07 12:50:50 +00:00
set_notification
2022-07-16 10:27:43 +00:00
mail to: @notification.member.email
2022-06-25 12:48:46 +00:00
end
def expired_30d_ago
2023-08-07 12:50:50 +00:00
set_notification
2022-07-16 10:27:43 +00:00
mail to: @notification.member.email
2022-06-25 12:48:46 +00:00
end
def expired_60d_ago
2023-08-07 12:50:50 +00:00
set_notification
2022-07-16 10:27:43 +00:00
mail to: @notification.member.email
2022-06-25 12:48:46 +00:00
end
def cancelled
2023-08-07 12:50:50 +00:00
set_notification
2022-07-16 10:27:43 +00:00
mail to: @notification.member.email
end
2022-06-25 12:48:46 +00:00
2023-08-07 12:50:50 +00:00
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
2022-07-16 10:27:43 +00:00
private
def set_notification
@notification = params[:notification]
@payment = @notification.member.create_payment
2022-06-25 12:48:46 +00:00
end
end