2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-11-20 11:57:51 +01:00
|
|
|
# Preview all emails at http://localhost:3000/rails/mailers/administration_mailer
|
2018-01-03 17:11:47 +01:00
|
|
|
class AdministrationMailer < ApplicationMailer
|
2018-01-05 11:16:50 +01:00
|
|
|
layout 'mailers/layout'
|
|
|
|
|
2024-03-19 17:17:44 +01:00
|
|
|
def invite_admin(user, reset_password_token)
|
2018-01-11 14:17:37 +01:00
|
|
|
@reset_password_token = reset_password_token
|
2020-09-17 16:37:11 +02:00
|
|
|
@user = user
|
2024-03-19 17:17:44 +01:00
|
|
|
@author_name = "Équipe de #{APPLICATION_NAME}"
|
2018-05-31 15:48:36 +02:00
|
|
|
subject = "Activez votre compte administrateur"
|
2018-05-31 23:58:10 +02:00
|
|
|
|
2024-05-29 12:24:05 +02:00
|
|
|
bypass_unverified_mail_protection!
|
|
|
|
|
2020-09-17 16:37:11 +02:00
|
|
|
mail(to: user.email,
|
2018-09-20 14:34:49 +02:00
|
|
|
subject: subject,
|
|
|
|
reply_to: CONTACT_EMAIL)
|
2018-01-11 14:17:37 +01:00
|
|
|
end
|
|
|
|
|
2018-03-27 13:52:34 +02:00
|
|
|
def refuse_admin(admin_email)
|
2018-05-31 15:48:36 +02:00
|
|
|
subject = "Votre demande de compte a été refusée"
|
2018-05-31 15:26:02 +02:00
|
|
|
|
2024-05-29 12:24:05 +02:00
|
|
|
bypass_unverified_mail_protection!
|
|
|
|
|
2018-03-27 13:52:34 +02:00
|
|
|
mail(to: admin_email,
|
2018-09-20 14:34:49 +02:00
|
|
|
subject: subject,
|
|
|
|
reply_to: CONTACT_EMAIL)
|
2018-03-27 13:52:34 +02:00
|
|
|
end
|
2023-10-18 07:10:26 +02:00
|
|
|
|
|
|
|
def self.critical_email?(action_name)
|
|
|
|
false
|
|
|
|
end
|
2016-02-23 16:51:24 +01:00
|
|
|
end
|