Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gaizka
Copy link

@gaizka gaizka commented Dec 19, 2012

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
Copy link
Owner

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

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
@chrisnicola
Copy link

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
Copy link

jamesds commented Dec 10, 2015

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

@rstrand
Copy link

rstrand commented Apr 26, 2016

@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
Labels
None yet
Projects
None yet
5 participants