Mails: move to their own namespace

This commit is contained in:
Simon Lehericey 2017-03-06 22:37:37 +01:00
parent 335caed65e
commit 02bbf0543f
15 changed files with 95 additions and 85 deletions

View file

@ -0,0 +1,15 @@
module Mails
class ClosedMail < ActiveRecord::Base
include MailTemplateConcern
def name
"Accusé d'acceptation"
end
def self.default
obj = "Votre dossier TPS N°--numero_dossier-- a été accepté"
body = ActionController::Base.new.render_to_string(template: 'notification_mailer/closed_mail')
ClosedMail.new(object: obj, body: body)
end
end
end

View file

@ -0,0 +1,15 @@
module Mails
class InitiatedMail < ActiveRecord::Base
include MailTemplateConcern
def name
"Accusé de réception"
end
def self.default
obj = "Votre dossier TPS N°--numero_dossier-- a été bien reçu"
body = ActionController::Base.new.render_to_string(template: 'notification_mailer/initiated_mail')
InitiatedMail.new(object: obj, body: body)
end
end
end

View file

@ -0,0 +1,15 @@
module Mails
class ReceivedMail < ActiveRecord::Base
include MailTemplateConcern
def name
"Accusé de passage en instruction"
end
def self.default
obj = "Votre dossier TPS N°--numero_dossier-- va être instruit"
body = ActionController::Base.new.render_to_string(template: 'notification_mailer/received_mail')
ReceivedMail.new(object: obj, body: body)
end
end
end

View file

@ -0,0 +1,15 @@
module Mails
class RefusedMail < ApplicationRecord
include MailTemplateConcern
def name
"Accusé de rejet du dossier"
end
def self.default
obj = "Votre dossier TPS N°--numero_dossier-- a été refusé"
body = ActionController::Base.new.render_to_string(template: 'notification_mailer/refused_mail')
RefusedMail.new(object: obj, body: body)
end
end
end

View file

@ -0,0 +1,15 @@
module Mails
class WithoutContinuationMail < ApplicationRecord
include MailTemplateConcern
def name
"Accusé de classement sans suite"
end
def self.default
obj = "Votre dossier TPS N°--numero_dossier-- a été classé sans suite"
body = ActionController::Base.new.render_to_string(template: 'notification_mailer/without_continuation_mail')
WithoutContinuationMail.new(object: obj, body: body)
end
end
end