2017-01-23 15:41:09 +01:00
|
|
|
class NotificationMailerPreview < ActionMailer::Preview
|
2018-11-19 18:14:35 +01:00
|
|
|
def send_initiated_notification
|
2019-03-14 10:39:38 +01:00
|
|
|
p = Procedure.where(id: Mails::InitiatedMail.where("body like ?", "%<img%").pluck(:procedure_id).uniq).order("RANDOM()").first
|
|
|
|
NotificationMailer.send_initiated_notification(p.dossiers.last)
|
2017-01-23 15:41:09 +01:00
|
|
|
end
|
2018-11-19 18:14:35 +01:00
|
|
|
|
2019-07-23 14:59:57 +02:00
|
|
|
def send_dossier_received
|
|
|
|
NotificationMailer.send_dossier_received(Dossier.last)
|
|
|
|
end
|
|
|
|
|
2018-11-19 18:14:35 +01:00
|
|
|
def send_closed_notification
|
|
|
|
NotificationMailer.send_closed_notification(Dossier.last)
|
|
|
|
end
|
|
|
|
|
|
|
|
def send_refused_notification
|
2019-07-23 14:59:57 +02:00
|
|
|
dossier = Dossier.last.tap { |d| d.assign_attributes(motivation: 'Le montant demandé dépasse le plafond autorisé') }
|
|
|
|
NotificationMailer.send_refused_notification(dossier)
|
2018-11-19 18:14:35 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def send_without_continuation_notification
|
|
|
|
NotificationMailer.send_without_continuation_notification(Dossier.last)
|
|
|
|
end
|
2017-01-23 15:41:09 +01:00
|
|
|
end
|