Sha256: b376693c20fb97c377f0b861edebf899bf3eee4b3f56b0ff587a638476dadaf3

Contents?: true

Size: 371 Bytes

Versions: 12

Compression:

Stored size: 371 Bytes

Contents

module AhoyEmail
  class MessageSubscriber
    def track_click(event)
      message = AhoyEmail.message_model.find_by(token: event[:token])
      if message
        message.clicked ||= true if message.respond_to?(:clicked=)
        message.clicked_at ||= Time.now if message.respond_to?(:clicked_at=)
        message.save! if message.changed?
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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