the-refinery / sparkpost_rails

Sparkpost delivery method for ActionMailer
MIT License
66 stars 62 forks source link

SparkPostRails::DeliveryException ([{"message"=>"invalid data format/type" #42

Closed edgeroute closed 7 years ago

edgeroute commented 7 years ago

I'm getting this message when I try to send an email:

SparkPostRails::DeliveryException ([{"message"=>"invalid data format/type", "description"=>"content.headers json dictionary value has type 'json_array' when expecting type 'string'", "code"=>"1300"}]):

Mailer: mail(to: @user.email, subject: "subject", sparkpost_data: {track_opens: true, track_clicks: true})

Controller: result = CertificateMailer.email_certificate(current_user).deliver!

edgeroute commented 7 years ago

This error is happening when I push this code out to a Heroku staging instance. The code works fine on my local machine. Any thoughts as to how Heroku execution could be messing with the ability to SparkPostRails to operate correctly?

edgeroute commented 7 years ago

Was a result of leaving in old require Rails.root.join("config/smtp") in production.rb. As soon as I removed that, it went away. Issue is a non-issue.