Skip to content

Instantly share code, notes, and snippets.

@nburkley
Last active December 30, 2019 11:14
Show Gist options
  • Save nburkley/d0f7d1b5b12fc9832404e7e28b42d02e to your computer and use it in GitHub Desktop.
Save nburkley/d0f7d1b5b12fc9832404e7e28b42d02e to your computer and use it in GitHub Desktop.
Use `bbc` instead of `to` to hide list of recipienta
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
@nburkley
Copy link
Author

@glaszig, good point — I've updated the gist to use bbc instead of to. Thanks for bringing it to my attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment