Skip to content

Instantly share code, notes, and snippets.

@miloops
Created December 6, 2011 13:32
Show Gist options
  • Save miloops/1438218 to your computer and use it in GitHub Desktop.
Save miloops/1438218 to your computer and use it in GitHub Desktop.
class CampaignMailer < ActionMailer::Base
def omg_notification(zomg)
mail :to => # ...
end
end
class DefaultMailer < ActionMailer::Base
include Sendgrid
def notification(asd)
sendgrid_mail :to => # ...
end
end
module Sendgrid
def sendgrid_mail(*args)
mail_message = mail(*args)
mail_message.delivery_method.settings.merge!(APP_CONFIG[:sendgrid_config])
mail_message
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment