lib/ahoy_email/interceptor.rb in ahoy_email-0.0.1 vs lib/ahoy_email/interceptor.rb in ahoy_email-0.0.2
- old
+ new
@@ -1,24 +1,11 @@
module AhoyEmail
class Interceptor
- # include ActionView::Helpers::AssetTagHelper
+ class << self
- 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
+ def delivering_email(message)
+ AhoyEmail::Processor.new(message).mark_sent!
+ end
+ end
end
end