cb890343ff
feat(user.merge): ensure to merge user.targeted_user_link Update app/models/targeted_user_link.rb Co-authored-by: LeSim <mail@simon.lehericey.net> Update app/models/targeted_user_link.rb Co-authored-by: LeSim <mail@simon.lehericey.net> Update app/models/targeted_user_link.rb Co-authored-by: LeSim <mail@simon.lehericey.net> feat(db/create_targeted_user_links): ensure not null with fk
17 lines
534 B
Ruby
17 lines
534 B
Ruby
# Preview all emails at http://localhost:3000/rails/mailers/avis_mailer
|
|
class AvisMailer < ApplicationMailer
|
|
helper MailerHelper
|
|
|
|
layout 'mailers/layout'
|
|
|
|
def avis_invitation(avis, targeted_user_link)
|
|
if avis.dossier.visible_by_administration?
|
|
@avis = avis
|
|
email = @avis.expert&.email
|
|
@url = targeted_user_link_url(targeted_user_link)
|
|
subject = "Donnez votre avis sur le dossier nº #{@avis.dossier.id} (#{@avis.dossier.procedure.libelle})"
|
|
|
|
mail(to: email, subject: subject)
|
|
end
|
|
end
|
|
end
|