current_emails = NosOignons::Mailman.list_members(list)
uptodate_emails = NosOignons::Member.all.select(&:up_to_date?).collect(&:email)
- NosOignons::Mailman.add_members(list, uptodate_emails - current_emails)
- NosOignons::Mailman.remove_members(list, current_emails - uptodate_emails)
+ emails_to_add = uptodate_emails - current_emails
+ NosOignons::Mailman.add_members(list, emails_to_add) unless emails_to_add.empty?
+ emails_to_remove = current_emails - uptodate_emails
+ NosOignons::Mailman.remove_members(list, emails_to_remove) unless emails_to_remove.empty?
end
def send_membership_reminders!