From 12ea377812d0e4c5fedcd22366978e4ebff7a366 Mon Sep 17 00:00:00 2001 From: echarp Date: Sun, 22 Dec 2019 11:58:20 +0100 Subject: [PATCH] Locale is added to all sent emails, as a header See https://tools.ietf.org/html/rfc2076#section-3.10 --- app/mailers/event_mailer.rb | 12 ++++++++---- app/mailers/moderation_mailer.rb | 12 ++++++++---- app/mailers/moderationorga_mailer.rb | 12 ++++++++---- app/mailers/note_mailer.rb | 6 ++++-- app/mailers/orga_mailer.rb | 12 ++++++++---- 5 files changed, 36 insertions(+), 18 deletions(-) diff --git a/app/mailers/event_mailer.rb b/app/mailers/event_mailer.rb index b6b968c0..e157964f 100644 --- a/app/mailers/event_mailer.rb +++ b/app/mailers/event_mailer.rb @@ -8,7 +8,8 @@ class EventMailer < ApplicationMailer mail 'Message-ID' => "", to: event.submitter, - subject: subject(event) + subject: subject(event), + 'Content-Language': locale end # Send email to submitter too. Before, only moderators were receiving emails @@ -20,7 +21,8 @@ class EventMailer < ApplicationMailer mail 'In-Reply-To' => "", to: event.submitter, - subject: subject(event) + subject: subject(event), + 'Content-Language': locale end def accept(event) @@ -31,7 +33,8 @@ class EventMailer < ApplicationMailer "", to: event.submitter, subject: "#{t 'mail_prefix'}#{t 'event_mailer.accept.subject', - subject: event.title}" + subject: event.title}", + 'Content-Language': locale end def destroy(event) @@ -42,7 +45,8 @@ class EventMailer < ApplicationMailer "", to: event.submitter, subject: "#{t 'mail_prefix'}#{t 'event_mailer.destroy.subject', - subject: event.title}" + subject: event.title}", + 'Content-Language': locale end private diff --git a/app/mailers/moderation_mailer.rb b/app/mailers/moderation_mailer.rb index 9bfcbe16..fe7109c6 100644 --- a/app/mailers/moderation_mailer.rb +++ b/app/mailers/moderation_mailer.rb @@ -7,7 +7,8 @@ class ModerationMailer < ApplicationMailer mail 'Message-ID' => "", - subject: subject(event) + subject: subject(event), + 'Content-Language': locale end def update(event) @@ -16,7 +17,8 @@ class ModerationMailer < ApplicationMailer mail 'In-Reply-To' => "", - subject: subject(event) + subject: subject(event), + 'Content-Language': locale end def accept(event) @@ -25,7 +27,8 @@ class ModerationMailer < ApplicationMailer mail 'In-Reply-To' => "", - subject: subject(event) + subject: subject(event), + 'Content-Language': locale end def destroy(event) @@ -34,7 +37,8 @@ class ModerationMailer < ApplicationMailer mail 'In-Reply-To' => "", - subject: subject(event) + subject: subject(event), + 'Content-Language': locale end private diff --git a/app/mailers/moderationorga_mailer.rb b/app/mailers/moderationorga_mailer.rb index f47de21f..d5d12cc8 100644 --- a/app/mailers/moderationorga_mailer.rb +++ b/app/mailers/moderationorga_mailer.rb @@ -7,7 +7,8 @@ class ModerationorgaMailer < ApplicationMailer mail 'Message-ID' => "", - subject: subject(orga) + subject: subject(orga), + 'Content-Language': locale end def update(orga) @@ -16,7 +17,8 @@ class ModerationorgaMailer < ApplicationMailer mail 'In-Reply-To' => "", - subject: subject(orga) + subject: subject(orga), + 'Content-Language': locale end def accept(orga) @@ -25,7 +27,8 @@ class ModerationorgaMailer < ApplicationMailer mail 'In-Reply-To' => "", - subject: subject(orga) + subject: subject(orga), + 'Content-Language': locale end def destroy(orga, reason = '') @@ -35,7 +38,8 @@ class ModerationorgaMailer < ApplicationMailer mail 'In-Reply-To' => "", - subject: subject(orga) + subject: subject(orga), + 'Content-Language': locale end private diff --git a/app/mailers/note_mailer.rb b/app/mailers/note_mailer.rb index 51a77912..676e5f5f 100644 --- a/app/mailers/note_mailer.rb +++ b/app/mailers/note_mailer.rb @@ -9,7 +9,8 @@ class NoteMailer < ApplicationMailer mail 'In-Reply-To' => "", to: note.event.submitter, - subject: subject(note.event) + subject: subject(note.event), + 'Content-Language': locale end def create(note) @@ -17,7 +18,8 @@ class NoteMailer < ApplicationMailer mail 'In-Reply-To' => "", - subject: subject(note.event) + subject: subject(note.event), + 'Content-Language': locale end private diff --git a/app/mailers/orga_mailer.rb b/app/mailers/orga_mailer.rb index 309ea2e0..f3510838 100644 --- a/app/mailers/orga_mailer.rb +++ b/app/mailers/orga_mailer.rb @@ -8,7 +8,8 @@ class OrgaMailer < ApplicationMailer mail 'Message-ID' => "", to: orga.submitter, - subject: subject(orga) + subject: subject(orga), + 'Content-Language': locale end def update(orga) @@ -18,7 +19,8 @@ class OrgaMailer < ApplicationMailer mail 'Message-ID' => "", to: orga.submitter, - subject: subject(orga) + subject: subject(orga), + 'Content-Language': locale end def accept(orga) @@ -28,7 +30,8 @@ class OrgaMailer < ApplicationMailer mail 'In-Reply-To' => "", to: orga.submitter, - subject: subject(orga) + subject: subject(orga), + 'Content-Language': locale end def destroy(orga, reason = '') @@ -39,7 +42,8 @@ class OrgaMailer < ApplicationMailer mail 'In-Reply-To' => "", to: orga.submitter, - subject: subject(orga) + subject: subject(orga), + 'Content-Language': locale end private