Permalink
Browse files

Merge pull request #5 from einarmagnus/master

let mail() return a mailing object
  • Loading branch information...
2 parents dffbb83 + 4ff3e21 commit ed2dede7934cf65502193601da42a689ba68000c @stephenb committed Oct 5, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/sendgrid.rb
View
@@ -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
@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

0 comments on commit ed2dede

Please sign in to comment.