InitiatedEmail: add initiated email
This commit is contained in:
parent
6be76095c6
commit
47fc6e6957
5 changed files with 51 additions and 1 deletions
15
app/models/initiated_mail.rb
Normal file
15
app/models/initiated_mail.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
class InitiatedMail < MailTemplate
|
||||
def name
|
||||
"E-mail d'accusé de réception"
|
||||
end
|
||||
|
||||
def self.default
|
||||
obj = "[TPS] Accusé de réception pour votre dossier n°--numero_dossier--"
|
||||
body = ActionController::Base.new.render_to_string(template: 'notification_mailer/initiated_mail')
|
||||
InitiatedMail.new(object: obj, body: body)
|
||||
end
|
||||
|
||||
def self.slug
|
||||
self.name.parameterize
|
||||
end
|
||||
end
|
|
@ -6,6 +6,8 @@ class Procedure < ActiveRecord::Base
|
|||
has_many :mail_templates
|
||||
has_one :mail_received
|
||||
|
||||
has_one :initiated_mail
|
||||
|
||||
has_one :procedure_path, dependent: :destroy
|
||||
|
||||
has_one :module_api_carto, dependent: :destroy
|
||||
|
|
11
app/views/notification_mailer/initiated_mail.html.erb
Normal file
11
app/views/notification_mailer/initiated_mail.html.erb
Normal file
|
@ -0,0 +1,11 @@
|
|||
Bonjour,
|
||||
<br>
|
||||
<br>
|
||||
Votre administration vous confirme la bonne réception de votre dossier n°--numero_dossier-- complet. Celui-ci sera instruit dans le délai légal déclaré par votre interlocuteur.<br>
|
||||
<br>
|
||||
En vous souhaitant une bonne journée,
|
||||
<br>
|
||||
<br>
|
||||
---
|
||||
<br>
|
||||
L'équipe TPS
|
12
db/migrate/20170302105557_create_initiated_mails.rb
Normal file
12
db/migrate/20170302105557_create_initiated_mails.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
class CreateInitiatedMails < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :initiated_mails do |t|
|
||||
t.text :object
|
||||
t.text :body
|
||||
t.belongs_to :procedure, index: true, unique: true, foreign_key: true
|
||||
|
||||
t.column :created_at, :timestamp, null: true
|
||||
t.column :updated_at, :timestamp, null: true
|
||||
end
|
||||
end
|
||||
end
|
12
db/schema.rb
12
db/schema.rb
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20170228150522) do
|
||||
ActiveRecord::Schema.define(version: 20170302105557) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -225,6 +225,15 @@ ActiveRecord::Schema.define(version: 20170228150522) do
|
|||
t.index ["dossier_id"], name: "index_individuals_on_dossier_id", using: :btree
|
||||
end
|
||||
|
||||
create_table "initiated_mails", force: :cascade do |t|
|
||||
t.text "object"
|
||||
t.text "body"
|
||||
t.integer "procedure_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["procedure_id"], name: "index_initiated_mails_on_procedure_id", using: :btree
|
||||
end
|
||||
|
||||
create_table "invites", force: :cascade do |t|
|
||||
t.string "email"
|
||||
t.string "email_sender"
|
||||
|
@ -388,6 +397,7 @@ ActiveRecord::Schema.define(version: 20170228150522) do
|
|||
add_foreign_key "cerfas", "dossiers"
|
||||
add_foreign_key "commentaires", "dossiers"
|
||||
add_foreign_key "dossiers", "users"
|
||||
add_foreign_key "initiated_mails", "procedures"
|
||||
add_foreign_key "procedure_paths", "administrateurs"
|
||||
add_foreign_key "procedure_paths", "procedures"
|
||||
|
||||
|
|
Loading…
Reference in a new issue