Question

I am trying to ensure that a request for a new password gets sent to a user's email even if they are on the unsubscribed list. I have included my reset_password function:

def reset_password_instructions(record, opts={}, info)

headers["X-SMTPAPI"] = {
                        :filters => {:bypass_list_management => { :settings => { :enable => 0 } } }
                       }.to_json
super

end

Am I sending over the header incorrectly?

Here is the relevant link from the sendgrid docs - http://sendgrid.com/docs/API_Reference/SMTP_API/apps.html. This filter I am using is at the bottom.

Any help would be very much appreciated.

Was it helpful?

Solution

Change enable to 1.

Your current configuration turns the app off, instead of on. If you change it to, the following it should work:

def reset_password_instructions(record, opts={}, info)
    headers["X-SMTPAPI"] = {
        :filters => {:bypass_list_management => { :settings => { :enable => 0 } } }
    }.to_json
    super
end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top