Adds support for setting default "sendgrid_disable" options at mailer level, not just emails #9

Open
wants to merge 1 commit into
from

Projects

None yet

5 participants

@gaizka

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

@stephenb
Owner

Sorry for delay on addressing this. Is this necessary since the default behavior would be that it's disabled?

@gaizka gaizka Add sendgrid_disable for whole mailer, not just individual 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
c2779c4
@chrisnicola

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.

@jamesds

+1 from me for the same reason as @chrisnicola. DRY code is good :)

@rstrand

@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.

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