Browse Source

Locale is added to all sent emails, as a header

See https://tools.ietf.org/html/rfc2076#section-3.10
remotes/origin/master
echarp 2 years ago
parent
commit
12ea377812
  1. 12
      app/mailers/event_mailer.rb
  2. 12
      app/mailers/moderation_mailer.rb
  3. 12
      app/mailers/moderationorga_mailer.rb
  4. 6
      app/mailers/note_mailer.rb
  5. 12
      app/mailers/orga_mailer.rb

12
app/mailers/event_mailer.rb

@ -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

12
app/mailers/moderation_mailer.rb

@ -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

12
app/mailers/moderationorga_mailer.rb

@ -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

6
app/mailers/note_mailer.rb

@ -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

12
app/mailers/orga_mailer.rb

@ -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

Loading…
Cancel
Save