The BulletproofMailer class in lib/bulletproof_mailer.rb was originally introduced to allow emails to be cancelled by calling abort_delivery, which throws an error and prevents an email from being sent. But as redsummernight points out, this workaround is no longer necessary in the current version of Rails.
To modernize the handling of aborted emails and clean up the codebase, it would be nice to make the following changes:
Update UserMailer to extend ActionMailer::Base instead of BulletMailer::Base.
Update UserMailer#batch_subscription_notification to use return instead of abort_delivery.
Testing Instructions: We need to make sure that subscription notifications can be cancelled. Specifically:
Log in as User A.
Subscribe to User B.
Log in as User B.
Post a new work.
Immediately after posting, edit the work and add it to an Anonymous collection.
Wait for subscription notifications to be sent, and make sure that User A didn't receive an email.
Check Resque to make sure that the subscription notification didn't produce a failed job.