Last active
December 30, 2019 11:14
-
-
Save nburkley/d0f7d1b5b12fc9832404e7e28b42d02e to your computer and use it in GitHub Desktop.
Use `bbc` instead of `to` to hide list of recipienta
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
users_by_locale.each do |locale, locale_users| | |
I18n.with_locale(locale) do | |
mail( | |
bcc: locale_users.map(&:email), | |
subject: I18n.t('user_mailer.new_follower.subject') | |
) | |
end | |
end | |
private | |
def users_by_locale | |
@users.group_by { |user| user.locale } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@glaszig, good point — I've updated the gist to use
bbc
instead ofto
. Thanks for bringing it to my attention.