Locale is added to all sent emails, as a header

See https://tools.ietf.org/html/rfc2076#section-3.10
This commit is contained in:
echarp 2019-12-22 11:58:20 +01:00
parent e7071ee180
commit 12ea377812
5 changed files with 36 additions and 18 deletions

View File

@ -8,7 +8,8 @@ class EventMailer < ApplicationMailer
mail 'Message-ID' =>
"<event-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
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' =>
"<event-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
to: event.submitter,
subject: subject(event)
subject: subject(event),
'Content-Language': locale
end
def accept(event)
@ -31,7 +33,8 @@ class EventMailer < ApplicationMailer
"<event-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
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
"<event-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
to: event.submitter,
subject: "#{t 'mail_prefix'}#{t 'event_mailer.destroy.subject',
subject: event.title}"
subject: event.title}",
'Content-Language': locale
end
private

View File

@ -7,7 +7,8 @@ class ModerationMailer < ApplicationMailer
mail 'Message-ID' =>
"<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
subject: subject(event)
subject: subject(event),
'Content-Language': locale
end
def update(event)
@ -16,7 +17,8 @@ class ModerationMailer < ApplicationMailer
mail 'In-Reply-To' =>
"<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
subject: subject(event)
subject: subject(event),
'Content-Language': locale
end
def accept(event)
@ -25,7 +27,8 @@ class ModerationMailer < ApplicationMailer
mail 'In-Reply-To' =>
"<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
subject: subject(event)
subject: subject(event),
'Content-Language': locale
end
def destroy(event)
@ -34,7 +37,8 @@ class ModerationMailer < ApplicationMailer
mail 'In-Reply-To' =>
"<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
subject: subject(event)
subject: subject(event),
'Content-Language': locale
end
private

View File

@ -7,7 +7,8 @@ class ModerationorgaMailer < ApplicationMailer
mail 'Message-ID' =>
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
subject: subject(orga)
subject: subject(orga),
'Content-Language': locale
end
def update(orga)
@ -16,7 +17,8 @@ class ModerationorgaMailer < ApplicationMailer
mail 'In-Reply-To' =>
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
subject: subject(orga)
subject: subject(orga),
'Content-Language': locale
end
def accept(orga)
@ -25,7 +27,8 @@ class ModerationorgaMailer < ApplicationMailer
mail 'In-Reply-To' =>
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
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' =>
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
subject: subject(orga)
subject: subject(orga),
'Content-Language': locale
end
private

View File

@ -9,7 +9,8 @@ class NoteMailer < ApplicationMailer
mail 'In-Reply-To' =>
"<event-#{note.event.id}@#{host}>",
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' =>
"<mod-#{note.event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
subject: subject(note.event)
subject: subject(note.event),
'Content-Language': locale
end
private

View File

@ -8,7 +8,8 @@ class OrgaMailer < ApplicationMailer
mail 'Message-ID' =>
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
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' =>
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
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' =>
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
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' =>
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
to: orga.submitter,
subject: subject(orga)
subject: subject(orga),
'Content-Language': locale
end
private