FIX: Remove 'reply above line' marker (#13927)

This marker is automatically added by Discourse's group SMTP mailer.
When user responded to emails sent by it, Discourse did not trim this
marker.
This commit is contained in:
Bianca Nenciu
2021-08-03 20:08:19 +03:00
committed by GitHub
parent e2c415457c
commit 54e2b95539
3 changed files with 26 additions and 1 deletions

View File

@ -552,8 +552,13 @@ module Email
@previous_replies_regex ||= /^--[- ]\n\*#{I18n.t("user_notifications.previous_discussion")}\*\n/im
end
def reply_above_line_regex
@reply_above_line_regex ||= /\n#{I18n.t("user_notifications.reply_above_line")}\n/im
end
def trim_discourse_markers(reply)
reply.split(previous_replies_regex)[0]
reply = reply.split(previous_replies_regex)[0]
reply.split(reply_above_line_regex)[0]
end
def parse_from_field(mail = nil)