mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: proper mailing list mode
once enable_mailing_list_mode is enabled any user can elect to get every post via email unless they opt out of category or topic
This commit is contained in:
@@ -135,8 +135,17 @@ class PostCreator
|
||||
end
|
||||
|
||||
def after_post_create
|
||||
if !@topic.private_message? && @post.post_number > 1 && @post.post_type != Post.types[:moderator_action]
|
||||
TopicTrackingState.publish_unread(@post)
|
||||
if !@topic.private_message? && @post.post_type != Post.types[:moderator_action]
|
||||
if @post.post_number > 1
|
||||
TopicTrackingState.publish_unread(@post)
|
||||
end
|
||||
if SiteSetting.enable_mailing_list_mode
|
||||
Jobs.enqueue_in(
|
||||
SiteSetting.email_time_window_mins.minutes,
|
||||
:notify_mailing_list_subscribers,
|
||||
post_id: @post.id
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ class TopicCreator
|
||||
@topic.notifier.watch_topic!(id, nil)
|
||||
end
|
||||
|
||||
TopicUser.auto_watch_new_topic(@topic.id)
|
||||
CategoryUser.auto_watch_new_topic(@topic)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user