Sha256: e395ec2873c5b2dd2eeaac4b522ab655242f464e07c5f5158f8cc177e4d7ac4c

Contents?: true

Size: 1016 Bytes

Versions: 5

Compression:

Stored size: 1016 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

5 entries across 5 versions & 1 rubygems

Version Path
mail_engine-0.1.3 lib/mail_engine/sendgrid/base.rb
mail_engine-0.1.2 lib/mail_engine/sendgrid/base.rb
mail_engine-0.1.1 lib/mail_engine/sendgrid/base.rb
mail_engine-0.1.0 lib/mail_engine/sendgrid/base.rb
mail_engine-0.0.1 lib/mail_engine/sendgrid/base.rb