Sha256: 9b11f5ddddcb5ffd84986c68736985f72d07b2e821ef50447ef373317b0b7b58

Contents?: true

Size: 626 Bytes

Versions: 12

Compression:

Stored size: 626 Bytes

Contents

module AhoyEmail
  class Tracker
    attr_reader :message

    def initialize(message)
      @message = message
    end

    def perform
      Safely.safely do
        # perform_deliveries check still needed in observer
        if message.perform_deliveries
          if message.ahoy_data
            data = message.ahoy_data.merge(message: message)
            message.ahoy_message = AhoyEmail.track_method.call(data)
          end

          if message.ahoy_options && message.ahoy_options[:click]
            Utils.publish(:send, message.ahoy_options.slice(:campaign))
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ahoy_email-2.4.0 lib/ahoy_email/tracker.rb
ahoy_email-2.3.1 lib/ahoy_email/tracker.rb
ahoy_email-2.3.0 lib/ahoy_email/tracker.rb
ahoy_email-2.2.0 lib/ahoy_email/tracker.rb
ahoy_email-2.1.3 lib/ahoy_email/tracker.rb
ahoy_email-2.1.2 lib/ahoy_email/tracker.rb
ahoy_email-2.1.1 lib/ahoy_email/tracker.rb
ahoy_email-2.1.0 lib/ahoy_email/tracker.rb
ahoy_email-2.0.3 lib/ahoy_email/tracker.rb
ahoy_email-2.0.2 lib/ahoy_email/tracker.rb
ahoy_email-2.0.1 lib/ahoy_email/tracker.rb
ahoy_email-2.0.0 lib/ahoy_email/tracker.rb