-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send emails to subscribers in batches of 50 to avoid SMTP limit #9570
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,11 +18,13 @@ def notify_node_creation(node) | |
.collect(&:email) | ||
recipients += node.author.followers.collect(&:email) | ||
recipients.uniq! | ||
mail( | ||
to: "notifications@#{ActionMailer::Base.default_url_options[:host]}", | ||
bcc: recipients, | ||
subject: subject | ||
) | ||
while recipients.length > 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
mail( | ||
to: "notifications@#{ActionMailer::Base.default_url_options[:host]}", | ||
bcc: recipients.pop(50), | ||
subject: subject | ||
) | ||
end | ||
end | ||
|
||
def notify_note_liked(node, user) | ||
|
@@ -64,11 +66,13 @@ def notify_tag_added(node, tag, tagging_user) | |
end | ||
end | ||
@footer = feature('email-footer') | ||
mail( | ||
to: "notifications@#{ActionMailer::Base.default_url_options[:host]}", | ||
bcc: recipients, | ||
subject: subject | ||
) | ||
while recipients.length > 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
mail( | ||
to: "notifications@#{ActionMailer::Base.default_url_options[:host]}", | ||
bcc: recipients.pop(50), | ||
subject: subject | ||
) | ||
end | ||
end | ||
|
||
def send_digest(user_id, nodes, frequency) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
recipients.length.positive?
instead ofrecipients.length > 0
.