Sha256: 9c9198fac5a7601229b23c607eac0706c41622d6ffe4954793cac6cd45cbe4cf

Contents?: true

Size: 647 Bytes

Versions: 1

Compression:

Stored size: 647 Bytes

Contents

module AhoyEmail
  class Interceptor
    # include ActionView::Helpers::AssetTagHelper

    def self.delivering_email(message)
      # body = (message.html_part || message).body.raw_source
      # p AhoyEmail::Engine.routes
      # if body
      #   regex = /<\/body>/i
      #   pixel = image_tag(AhoyEmail::Engine.routes.url_helpers.url_for(controller: "messages", action: "open"))
      #   if body.match(regex)
      #     body.gsub!(regex, "#{pixel}\\0")
      #   else
      #     body << pixel
      #   end
      # end
      Ahoy::Message.create!(
        subject: message.subject,
        content: message.to_s
      )
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ahoy_email-0.0.1 lib/ahoy_email/interceptor.rb