Adds support for setting default "sendgrid_disable" options at mailer level, not just emails
Then you can have:
class AdminMailer < ActionMailer::Base include SendGrid sendgrid_disable :subscriptiontrack
def this_has_subscriptiontrack_disabled ; end def this_has_subscriptiontrack_disabled_too ; end
def this_has_subscriptiontrack_enabled sendgrid_enable :subscriptiontrack end end
Sorry for delay on addressing this. Is this necessary since the default behavior would be that it's disabled?
I may be misunderstand this request, but this isn't the default option for things like :clicktrack or :opentrack. It depends on your settings at the account level, but you may have a mailer where you want those disabled.
In fact I assumed this worked this way and just found out this wasn't working after some testing. So I've had to add sendgrid_disable :clicktrack to each e-mail instead of just once. This would be helpful.
+1 from me for the same reason as @chrisnicola. DRY code is good :)
@stephenb The default behaviour when setting up a new account with Sendgrid is that click and open tracking is enabled on all emails unless a header is set explicitly disabling it. This feature would be very useful as it avoids having to disable click/open tracking in your Sendgrid account.