Sha256: e7af7fdcc1d849d0d6446d47a56acebaec7432c584be23d1a90249d860295e7c
Contents?: true
Size: 1.16 KB
Versions: 1
Compression:
Stored size: 1.16 KB
Contents
module SendGrid autoload :ApiHeader, 'send_grid/api_header' autoload :MailInterceptor, 'send_grid/mail_interceptor' autoload :VERSION, 'send_grid/version' autoload :Config, 'send_grid/config' def self.included(base) base.class_eval do include InstanceMethods delegate :substitute, :uniq_args, :category, :add_filter_setting, :deliver_at, :to => :sendgrid_header alias_method_chain :mail, :sendgrid alias_method :sendgrid_header, :send_grid_header end end module InstanceMethods def send_grid_header @send_grid_header ||= SendGrid::ApiHeader.new end def mail_with_sendgrid(headers={}, &block) mail_without_sendgrid(headers, &block).tap do |message| message.instance_variable_set :@sendgrid_header, sendgrid_header end end def open_tracking(enabled = true) add_filter_setting(:opentrack, :enabled, enabled ? 1 : 0) unless enabled.nil? end end class << self attr_writer :config def config @config ||= SendGrid::Config.new end # Sendgrid.config will be default if block is not passed def configure yield(self.config) if block_given? end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sendgrid-rails-2.0.5 | lib/send_grid.rb |