lib/ahoy_email/processor.rb in ahoy_email-1.0.1 vs lib/ahoy_email/processor.rb in ahoy_email-1.0.2

- old
+ new

@@ -29,13 +29,15 @@ end def track_message data = { mailer: options[:mailer], - extra: options[:extra] + extra: options[:extra], + user: options[:user] } + # legacy, remove in next major version user = options[:user] if user data[:user_type] = user.model_name.name id = user.id data[:user_id] = id.is_a?(Integer) ? id : id.to_s @@ -44,11 +46,11 @@ if options[:open] || options[:click] data[:token] = token end if options[:utm_params] - UTM_PARAMETERS.each do |k| - data[k] = options[k.to_sym] if options[k.to_sym] + UTM_PARAMETERS.map(&:to_sym).each do |k| + data[k] = options[k] if options[k] end end mailer.message.ahoy_data = data end