lib/mailgun/suppressions.rb in mailgun-ruby-1.2.0 vs lib/mailgun/suppressions.rb in mailgun-ruby-1.2.3
- old
+ new
@@ -155,10 +155,13 @@
raise Mailgun::ParameterError.new "Unsubscribe MUST include a :address key: #{unsubscribe}"
end
unsubscribe.each do |k, v|
# Hash values MUST be strings.
- if not v.is_a? String then
+ # However, unsubscribes contain an array of tags
+ if v.is_a? Array
+ unsubscribe[k] = v.map(&:to_s)
+ elsif !v.is_a? String
unsubscribe[k] = v.to_s
end
end
valid.push unsubscribe