Mails: factorize default and change slug
This commit is contained in:
parent
02bbf0543f
commit
65e83dd6ec
14 changed files with 19 additions and 44 deletions
|
@ -2,14 +2,8 @@ module Mails
|
|||
class ClosedMail < ActiveRecord::Base
|
||||
include MailTemplateConcern
|
||||
|
||||
def name
|
||||
"Accusé d'acceptation"
|
||||
end
|
||||
DISPLAYED_NAME = "Accusé d'acceptation"
|
||||
DEFAULT_OBJECT = 'Votre dossier TPS N°--numero_dossier-- a été accepté'
|
||||
|
||||
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
|
||||
|
|
|
@ -2,14 +2,8 @@ module Mails
|
|||
class InitiatedMail < ActiveRecord::Base
|
||||
include MailTemplateConcern
|
||||
|
||||
def name
|
||||
"Accusé de réception"
|
||||
end
|
||||
DISPLAYED_NAME = 'Accusé de réception'
|
||||
DEFAULT_OBJECT = 'Votre dossier TPS N°--numero_dossier-- a été bien reçu'
|
||||
|
||||
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
|
||||
|
|
|
@ -2,14 +2,8 @@ module Mails
|
|||
class ReceivedMail < ActiveRecord::Base
|
||||
include MailTemplateConcern
|
||||
|
||||
def name
|
||||
"Accusé de passage en instruction"
|
||||
end
|
||||
DISPLAYED_NAME = 'Accusé de passage en instruction'
|
||||
DEFAULT_OBJECT = 'Votre dossier TPS N°--numero_dossier-- va être instruit'
|
||||
|
||||
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
|
||||
|
|
|
@ -2,14 +2,8 @@ module Mails
|
|||
class RefusedMail < ApplicationRecord
|
||||
include MailTemplateConcern
|
||||
|
||||
def name
|
||||
"Accusé de rejet du dossier"
|
||||
end
|
||||
DISPLAYED_NAME = 'Accusé de rejet du dossier'
|
||||
DEFAULT_OBJECT = 'Votre dossier TPS N°--numero_dossier-- a été refusé'
|
||||
|
||||
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
|
||||
|
|
|
@ -2,14 +2,8 @@ module Mails
|
|||
class WithoutContinuationMail < ApplicationRecord
|
||||
include MailTemplateConcern
|
||||
|
||||
def name
|
||||
"Accusé de classement sans suite"
|
||||
end
|
||||
DISPLAYED_NAME = 'Accusé de classement sans suite'
|
||||
DEFAULT_OBJECT = 'Votre dossier TPS N°--numero_dossier-- a été classé sans suite'
|
||||
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue