Skip to content

Instantly share code, notes, and snippets.

@pcasaretto
Last active March 7, 2019 14:13
Show Gist options
  • Save pcasaretto/1b2c5e051db129606e8ee7b088ce7ec7 to your computer and use it in GitHub Desktop.
Save pcasaretto/1b2c5e051db129606e8ee7b088ce7ec7 to your computer and use it in GitHub Desktop.
class LoggingTransactionalMailer < TransactionalMailer
def send_mail(user, mail)
p "sending email to user #{user.id}"
super(user.email, mail.body)
end
end
class BlockingLoggingTransactionalMailer < LoggingTransactionalMailer
def send_mail(user, mail)
return unless @user.has_active_subscription?
super(user.email, mail.body)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment