2022-06-25 12:48:46 +00:00
|
|
|
class NotificationMailer < ApplicationMailer
|
2023-09-20 13:19:35 +00:00
|
|
|
default to: ->() { @member.email }
|
|
|
|
|
2022-06-25 12:48:46 +00:00
|
|
|
def expiration_in_60d
|
2023-08-07 12:50:50 +00:00
|
|
|
set_notification
|
2023-09-20 13:19:35 +00:00
|
|
|
mail
|
2022-06-25 12:48:46 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def expiration_in_30d
|
2023-08-07 12:50:50 +00:00
|
|
|
set_notification
|
2023-09-20 13:19:35 +00:00
|
|
|
mail
|
2022-06-25 12:48:46 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def expired
|
2023-08-07 12:50:50 +00:00
|
|
|
set_notification
|
2023-09-20 13:19:35 +00:00
|
|
|
mail
|
2022-06-25 12:48:46 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def expired_30d_ago
|
2023-08-07 12:50:50 +00:00
|
|
|
set_notification
|
2023-09-20 13:19:35 +00:00
|
|
|
mail
|
2022-06-25 12:48:46 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def expired_60d_ago
|
2023-08-07 12:50:50 +00:00
|
|
|
set_notification
|
2023-09-20 13:19:35 +00:00
|
|
|
mail
|
2022-06-25 12:48:46 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def cancelled
|
2023-08-07 12:50:50 +00:00
|
|
|
set_notification
|
2023-09-20 13:19:35 +00:00
|
|
|
mail
|
2022-07-16 10:27:43 +00:00
|
|
|
end
|
2022-06-25 12:48:46 +00:00
|
|
|
|
2023-08-07 12:50:50 +00:00
|
|
|
def registration
|
2023-09-20 13:19:35 +00:00
|
|
|
set_member
|
|
|
|
mail
|
2023-08-07 12:50:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def first_payment_confirmation
|
2023-09-20 13:19:35 +00:00
|
|
|
set_contribution
|
|
|
|
mail
|
2023-08-07 12:50:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def payment_renewal_confirmation
|
2023-09-20 13:19:35 +00:00
|
|
|
set_contribution
|
|
|
|
mail
|
2023-08-07 12:50:50 +00:00
|
|
|
end
|
|
|
|
|
2022-07-16 10:27:43 +00:00
|
|
|
private
|
|
|
|
def set_notification
|
|
|
|
@notification = params[:notification]
|
2023-09-20 13:19:35 +00:00
|
|
|
@member = @notification.member
|
2023-07-12 18:13:08 +00:00
|
|
|
@payment = @notification.member.create_payment
|
2022-06-25 12:48:46 +00:00
|
|
|
end
|
2023-09-20 13:19:35 +00:00
|
|
|
|
|
|
|
def set_contribution
|
|
|
|
@contribution = params[:contribution]
|
|
|
|
@member = @contribution.member
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_member
|
|
|
|
@member = params[:member]
|
|
|
|
@payment = @member.create_payment
|
|
|
|
end
|
|
|
|
|
|
|
|
def default_i18n_subject
|
|
|
|
mailer_scope = self.class.mailer_name.tr("/", ".")
|
|
|
|
I18n.t(:subject, scope: [mailer_scope, action_name], organization_short_name: Config.organization_short_name)
|
|
|
|
end
|
2022-06-25 12:48:46 +00:00
|
|
|
end
|