mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -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?
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user