Work in Progress: Reply By Email:

- Add support classes and settings to enable reply by email
- Split out Email builder to be more OO, add many specs
This commit is contained in:
Robin Ward
2013-06-10 16:46:08 -04:00
parent e338e97fa3
commit e29f4a3496
25 changed files with 400 additions and 96 deletions

View File

@@ -3,6 +3,13 @@ class EmailLog < ActiveRecord::Base
validates_presence_of :email_type
validates_presence_of :to_address
before_create do
# We only generate a reply
if SiteSetting.reply_by_email_enabled?
self.reply_key = SecureRandom.hex(16)
end
end
after_create do
# Update last_emailed_at if the user_id is present
User.update_all("last_emailed_at = CURRENT_TIMESTAMP", id: user_id) if user_id.present?

View File

@@ -188,6 +188,10 @@ class SiteSetting < ActiveRecord::Base
setting(:regular_requires_likes_given, 1)
setting(:regular_requires_topic_reply_count, 3)
# Reply by Email Settings
setting(:reply_by_email_enabled, false)
setting(:reply_by_email_address, nil)
# Entropy checks
setting(:title_min_entropy, 10)
setting(:body_min_entropy, 7)