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:
parent
e7071ee180
commit
12ea377812
@ -8,7 +8,8 @@ class EventMailer < ApplicationMailer
|
|||||||
mail 'Message-ID' =>
|
mail 'Message-ID' =>
|
||||||
"<event-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<event-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
to: event.submitter,
|
to: event.submitter,
|
||||||
subject: subject(event)
|
subject: subject(event),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
# Send email to submitter too. Before, only moderators were receiving emails
|
# Send email to submitter too. Before, only moderators were receiving emails
|
||||||
@ -20,7 +21,8 @@ class EventMailer < ApplicationMailer
|
|||||||
mail 'In-Reply-To' =>
|
mail 'In-Reply-To' =>
|
||||||
"<event-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<event-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
to: event.submitter,
|
to: event.submitter,
|
||||||
subject: subject(event)
|
subject: subject(event),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
def accept(event)
|
def accept(event)
|
||||||
@ -31,7 +33,8 @@ class EventMailer < ApplicationMailer
|
|||||||
"<event-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<event-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
to: event.submitter,
|
to: event.submitter,
|
||||||
subject: "#{t 'mail_prefix'}#{t 'event_mailer.accept.subject',
|
subject: "#{t 'mail_prefix'}#{t 'event_mailer.accept.subject',
|
||||||
subject: event.title}"
|
subject: event.title}",
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy(event)
|
def destroy(event)
|
||||||
@ -42,7 +45,8 @@ class EventMailer < ApplicationMailer
|
|||||||
"<event-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<event-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
to: event.submitter,
|
to: event.submitter,
|
||||||
subject: "#{t 'mail_prefix'}#{t 'event_mailer.destroy.subject',
|
subject: "#{t 'mail_prefix'}#{t 'event_mailer.destroy.subject',
|
||||||
subject: event.title}"
|
subject: event.title}",
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -7,7 +7,8 @@ class ModerationMailer < ApplicationMailer
|
|||||||
|
|
||||||
mail 'Message-ID' =>
|
mail 'Message-ID' =>
|
||||||
"<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
subject: subject(event)
|
subject: subject(event),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
def update(event)
|
def update(event)
|
||||||
@ -16,7 +17,8 @@ class ModerationMailer < ApplicationMailer
|
|||||||
|
|
||||||
mail 'In-Reply-To' =>
|
mail 'In-Reply-To' =>
|
||||||
"<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
subject: subject(event)
|
subject: subject(event),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
def accept(event)
|
def accept(event)
|
||||||
@ -25,7 +27,8 @@ class ModerationMailer < ApplicationMailer
|
|||||||
|
|
||||||
mail 'In-Reply-To' =>
|
mail 'In-Reply-To' =>
|
||||||
"<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
subject: subject(event)
|
subject: subject(event),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy(event)
|
def destroy(event)
|
||||||
@ -34,7 +37,8 @@ class ModerationMailer < ApplicationMailer
|
|||||||
|
|
||||||
mail 'In-Reply-To' =>
|
mail 'In-Reply-To' =>
|
||||||
"<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
subject: subject(event)
|
subject: subject(event),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -7,7 +7,8 @@ class ModerationorgaMailer < ApplicationMailer
|
|||||||
|
|
||||||
mail 'Message-ID' =>
|
mail 'Message-ID' =>
|
||||||
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
subject: subject(orga)
|
subject: subject(orga),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
def update(orga)
|
def update(orga)
|
||||||
@ -16,7 +17,8 @@ class ModerationorgaMailer < ApplicationMailer
|
|||||||
|
|
||||||
mail 'In-Reply-To' =>
|
mail 'In-Reply-To' =>
|
||||||
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
subject: subject(orga)
|
subject: subject(orga),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
def accept(orga)
|
def accept(orga)
|
||||||
@ -25,7 +27,8 @@ class ModerationorgaMailer < ApplicationMailer
|
|||||||
|
|
||||||
mail 'In-Reply-To' =>
|
mail 'In-Reply-To' =>
|
||||||
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
subject: subject(orga)
|
subject: subject(orga),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy(orga, reason = '')
|
def destroy(orga, reason = '')
|
||||||
@ -35,7 +38,8 @@ class ModerationorgaMailer < ApplicationMailer
|
|||||||
|
|
||||||
mail 'In-Reply-To' =>
|
mail 'In-Reply-To' =>
|
||||||
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
subject: subject(orga)
|
subject: subject(orga),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -9,7 +9,8 @@ class NoteMailer < ApplicationMailer
|
|||||||
mail 'In-Reply-To' =>
|
mail 'In-Reply-To' =>
|
||||||
"<event-#{note.event.id}@#{host}>",
|
"<event-#{note.event.id}@#{host}>",
|
||||||
to: note.event.submitter,
|
to: note.event.submitter,
|
||||||
subject: subject(note.event)
|
subject: subject(note.event),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
def create(note)
|
def create(note)
|
||||||
@ -17,7 +18,8 @@ class NoteMailer < ApplicationMailer
|
|||||||
|
|
||||||
mail 'In-Reply-To' =>
|
mail 'In-Reply-To' =>
|
||||||
"<mod-#{note.event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<mod-#{note.event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
subject: subject(note.event)
|
subject: subject(note.event),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -8,7 +8,8 @@ class OrgaMailer < ApplicationMailer
|
|||||||
mail 'Message-ID' =>
|
mail 'Message-ID' =>
|
||||||
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
to: orga.submitter,
|
to: orga.submitter,
|
||||||
subject: subject(orga)
|
subject: subject(orga),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
def update(orga)
|
def update(orga)
|
||||||
@ -18,7 +19,8 @@ class OrgaMailer < ApplicationMailer
|
|||||||
mail 'Message-ID' =>
|
mail 'Message-ID' =>
|
||||||
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
to: orga.submitter,
|
to: orga.submitter,
|
||||||
subject: subject(orga)
|
subject: subject(orga),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
def accept(orga)
|
def accept(orga)
|
||||||
@ -28,7 +30,8 @@ class OrgaMailer < ApplicationMailer
|
|||||||
mail 'In-Reply-To' =>
|
mail 'In-Reply-To' =>
|
||||||
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
to: orga.submitter,
|
to: orga.submitter,
|
||||||
subject: subject(orga)
|
subject: subject(orga),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy(orga, reason = '')
|
def destroy(orga, reason = '')
|
||||||
@ -39,7 +42,8 @@ class OrgaMailer < ApplicationMailer
|
|||||||
mail 'In-Reply-To' =>
|
mail 'In-Reply-To' =>
|
||||||
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
"<orga-#{orga.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
||||||
to: orga.submitter,
|
to: orga.submitter,
|
||||||
subject: subject(orga)
|
subject: subject(orga),
|
||||||
|
'Content-Language': locale
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
Loading…
Reference in New Issue
Block a user