Allow empty subjects when receiving reply messages via SMTP
This commit is contained in:
parent
b029fb98d6
commit
52f322bf6e
1 changed files with 6 additions and 2 deletions
|
@ -38,13 +38,17 @@ class MessagesMailReceiver
|
||||||
message = @user.send_messages.new body: body,
|
message = @user.send_messages.new body: body,
|
||||||
group: @message.group,
|
group: @message.group,
|
||||||
private: @message.private,
|
private: @message.private,
|
||||||
received_email: data,
|
received_email: data
|
||||||
subject: mail.subject.gsub("[#{FoodsoftConfig[:name]}] ", "")
|
|
||||||
if @message.reply_to
|
if @message.reply_to
|
||||||
message.reply_to_message = @message.reply_to_message
|
message.reply_to_message = @message.reply_to_message
|
||||||
else
|
else
|
||||||
message.reply_to_message = @message
|
message.reply_to_message = @message
|
||||||
end
|
end
|
||||||
|
if mail.subject
|
||||||
|
message.subject = mail.subject.gsub("[#{FoodsoftConfig[:name]}] ", "")
|
||||||
|
else
|
||||||
|
message.subject = I18n.t('messages.model.reply_subject', subject: message.reply_to_message.subject)
|
||||||
|
end
|
||||||
message.add_recipients @message.recipients
|
message.add_recipients @message.recipients
|
||||||
message.add_recipients [@message.sender]
|
message.add_recipients [@message.sender]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue