Sha256: cb9d524752ac62597cd51c9c627a3dea95e70158f9cdd738453dad4f2c758d9c

Contents?: true

Size: 1017 Bytes

Versions: 12

Compression:

Stored size: 1017 Bytes

Contents

# ### Usage
# class UserMailer < SendgridMailer
#   sendgrid_header do
#     category "itjob"
#
#     filters {
#       opentrack "enable" => 1
#       clicktrack "enable" => 1
#       gravatar "enable" => 1
#       template "enable" => 1, "text/html" => "<p>Thanks for your subscription.</p>"
#       footer "enable" => 1, "text/plain" => "Thanks for your subscription.", "text/html" => "<p>Thanks for your subscription.</p>"
#     }
#   end
#
#   def notification(user)
#     mail :to => "x@x.com" do |format|
#       format.text
#       format.html_from_db
#     end
#   end
# end

require 'active_support/concern'

module MailEngine
  module Sendgrid
    module Base
      extend ActiveSupport::Concern

      included do
        cattr_accessor :sendgrid_config
      end

      module ClassMethods
        def sendgrid_header(&block)
          self.sendgrid_config = SmtpApi.new
          self.sendgrid_config.instance_eval(&block)
        end
      end

      module InstanceMethods
      end

    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mail_engine-0.1.15 lib/mail_engine/sendgrid/base.rb
mail_engine-0.1.14 lib/mail_engine/sendgrid/base.rb
mail_engine-0.1.13 lib/mail_engine/sendgrid/base.rb
mail_engine-0.1.12 lib/mail_engine/sendgrid/base.rb
mail_engine-0.1.11 lib/mail_engine/sendgrid/base.rb
mail_engine-0.1.10 lib/mail_engine/sendgrid/base.rb
mail_engine-0.1.9 lib/mail_engine/sendgrid/base.rb
mail_engine-0.1.8 lib/mail_engine/sendgrid/base.rb
mail_engine-0.1.7 lib/mail_engine/sendgrid/base.rb
mail_engine-0.1.6 lib/mail_engine/sendgrid/base.rb
mail_engine-0.1.5 lib/mail_engine/sendgrid/base.rb
mail_engine-0.1.4 lib/mail_engine/sendgrid/base.rb