Skip to content

Commit

Permalink
Merge pull request #5 from einarmagnus/master
Browse files Browse the repository at this point in the history
let mail() return a mailing object
  • Loading branch information
stephenb committed Oct 5, 2012
2 parents dffbb83 + 4ff3e21 commit ed2dede
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/sendgrid.rb
Expand Up @@ -167,14 +167,15 @@ def sendgrid_unique_args(args)
# Sets the custom X-SMTPAPI header after creating the email but before delivery
# NOTE: This override is used for Rails 3 ActionMailer classes.
def mail(headers={}, &block)
super
m = super

This comment has been minimized.

Copy link
@catilac

catilac May 8, 2013

Thank you for doing this, I was about to patch it myself.

When I reinstall the gem with v.1.1.0 it does not show up. Can you update the gem?

if @sg_substitutions && !@sg_substitutions.empty?
@sg_substitutions.each do |find, replace|
raise ArgumentError.new("Array for #{find} is not the same size as the recipient array") if replace.size != @sg_recipients.size
end
end
puts "SendGrid X-SMTPAPI: #{sendgrid_json_headers(message)}" if Object.const_defined?("SENDGRID_DEBUG_OUTPUT") && SENDGRID_DEBUG_OUTPUT
self.headers['X-SMTPAPI'] = sendgrid_json_headers(message)
m
end

else
Expand Down

0 comments on commit ed2dede

Please sign in to comment.