Merge branch 'dev'

This commit is contained in:
gregoirenovel 2018-06-07 17:58:20 +02:00
commit 748ce35677
4 changed files with 48 additions and 46 deletions

View file

@ -1,4 +1,3 @@
module Mailers
class NewAttestationMailer < ApplicationMailer class NewAttestationMailer < ApplicationMailer
include Rails.application.routes.url_helpers include Rails.application.routes.url_helpers
@ -30,4 +29,3 @@ module Mailers
HEREDOC HEREDOC
end end
end end
end

View file

@ -1,4 +1,3 @@
module Mailers
class ResendAttestationMailer < ApplicationMailer class ResendAttestationMailer < ApplicationMailer
include Rails.application.routes.url_helpers include Rails.application.routes.url_helpers
@ -26,4 +25,3 @@ module Mailers
HEREDOC HEREDOC
end end
end end
end

View file

@ -11,7 +11,7 @@ namespace :'2018_06_05_resend_attestations' do
dossier.attestation = dossier.build_attestation dossier.attestation = dossier.build_attestation
Mailers::ResendAttestationMailer.resend_attestation(dossier).deliver_later ResendAttestationMailer.resend_attestation(dossier).deliver_later
puts "Email envoyé à #{email} pour le dossier #{dossier.id}" puts "Email envoyé à #{email} pour le dossier #{dossier.id}"
end end
end end

View file

@ -33,12 +33,18 @@ namespace :'2018_06_05_send_new_attestation' do
dossiers.each do |dossier| dossiers.each do |dossier|
attestation = dossier.attestation attestation = dossier.attestation
if attestation
id = attestation.id
attestation.destroy attestation.destroy
puts "Attestation #{id} détruite"
end
dossier.attestation = dossier.build_attestation dossier.attestation = dossier.build_attestation
Mailers::NewAttestationMailer.new_attestation(dossier).deliver_later NewAttestationMailer.new_attestation(dossier).deliver_later
puts "Email envoyé à #{email} pour le dossier #{dossier.id}" puts "Email envoyé à #{dossier.user.email} pour le dossier #{dossier.id}"
puts
end end
end end
end end