The EmailBuilder now creates the Reply by Email Key if necessary.

This commit is contained in:
Robin Ward
2013-06-13 10:56:16 -04:00
parent cf9b6beb13
commit 49c09898e2
8 changed files with 77 additions and 100 deletions

View File

@ -42,7 +42,13 @@ module Email
to_address = @message.to
to_address = to_address.first if to_address.is_a?(Array)
EmailLog.create!(email_type: @email_type, to_address: to_address, user_id: @user.try(:id))
email_log = EmailLog.new(email_type: @email_type, to_address: to_address, user_id: @user.try(:id))
reply_key = @message.header['Discourse-Reply-Key'].to_s
email_log.reply_key = reply_key if reply_key.present?
email_log.save!
email_log
end
end