Include an [OpenStreetMap] prefix on the subject of message notifications
Put back the [OpenStreetMap] prefix to the subject line of email notifications of messages, but strip it again from any incoming email replies.
This commit is contained in:
parent
b4a22eee71
commit
2038cd52c6
3 changed files with 4 additions and 2 deletions
|
@ -48,7 +48,7 @@ class Notifier < ActionMailer::Base
|
|||
def message_notification(message)
|
||||
common_headers message.recipient
|
||||
from_header message.sender.display_name, "m", message.id, message.digest
|
||||
subject message.title
|
||||
subject I18n.t('notifier.message_notification.subject_header', :user => message.title, :locale => locale)
|
||||
body :to_user => message.recipient.display_name,
|
||||
:from_user => message.sender.display_name,
|
||||
:body => message.body,
|
||||
|
|
|
@ -1062,6 +1062,7 @@ en:
|
|||
header: "{{from_user}} has commented on your recent OpenStreetMap diary entry with the subject {{subject}}:"
|
||||
footer: "You can also read the comment at {{readurl}} and you can comment at {{commenturl}} or reply at {{replyurl}}"
|
||||
message_notification:
|
||||
subject_header: "[OpenStreetMap] {{subject}}"
|
||||
hi: "Hi {{to_user}},"
|
||||
header: "{{from_user}} has sent you a message through OpenStreetMap with the subject {{subject}}:"
|
||||
footer1: "You can also read the message at {{readurl}}"
|
||||
|
|
|
@ -15,6 +15,7 @@ else
|
|||
digest = message.digest
|
||||
from = message.recipient
|
||||
to = message.sender
|
||||
subject = message.subject.sub(/\[OpenStreetMap\] */, "")
|
||||
end
|
||||
|
||||
exit 0 unless recipient[3] == digest[0,6]
|
||||
|
@ -23,7 +24,7 @@ mail = TMail::Mail.parse(STDIN.readlines.join)
|
|||
|
||||
message = Message.new(:sender => from, :recipient => to,
|
||||
:sent_on => Time.now.getutc,
|
||||
:title => mail.subject,
|
||||
:title => subject,
|
||||
:body => mail.body)
|
||||
message.save!
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue