Sha256: b6b3c37839cd856a5744ba615c7436262b775f3dc08dcb6b294ce11130ec7dbe

Contents?: true

Size: 599 Bytes

Versions: 8

Compression:

Stored size: 599 Bytes

Contents

# frozen_string_literal: true

module Roadie
  module Rails
    # Extend instances of Mail with this to have it inlined automatically when
    # delivered. You'll need to assign some #roadie_options for it to actually
    # do anything.
    module InlineOnDelivery
      attr_accessor :roadie_options

      def deliver
        inline_styles
        super
      end

      def deliver!
        inline_styles
        super
      end

      private

      def inline_styles
        if (options = roadie_options)
          MailInliner.new(self, options).execute
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
roadie-rails-3.3.0 lib/roadie/rails/inline_on_delivery.rb
roadie-rails-3.1.0 lib/roadie/rails/inline_on_delivery.rb
roadie-rails-3.0.0 lib/roadie/rails/inline_on_delivery.rb
roadie-rails-2.3.0 lib/roadie/rails/inline_on_delivery.rb
roadie-rails-2.2.0 lib/roadie/rails/inline_on_delivery.rb
roadie-rails-2.1.1 lib/roadie/rails/inline_on_delivery.rb
roadie-rails-2.1.0 lib/roadie/rails/inline_on_delivery.rb
roadie-rails-2.0.0 lib/roadie/rails/inline_on_delivery.rb