Giter Site home page Giter Site logo

Comments (3)

somiryu avatar somiryu commented on August 27, 2024 1

Hi! I updated to rails 5 and it worked like a charm. I think this was the push I needed to make the update. Still, if this can be helpful, in rails 4.2 it raises two errors:

return true if elm&.dig(:email) == additonal_mail
I think I solved it by changing it for elm[:email] == additional_mail

With that I was able to send a mail with the simple fields (:to, :subject) and I think with :categories as well. The error was raised when I added the OptionalField :personalizations. I think uparsed_valuechanged its behavior in rails 5. So then gem could be usable in rails 4 with the above change, but not with personalizations at least.

Thanks for the reply!

from sendgrid-actionmailer.

tyrauber avatar tyrauber commented on August 27, 2024

Hi @somiryu, can you confirm you are on the current version of the gem. Also, if you could share a full stack trace that would be helpful. Specifically, which Mail::OptionalField is throwing this error.

from sendgrid-actionmailer.

mountriv99 avatar mountriv99 commented on August 27, 2024

Hi I'm still getting this when trying it out in the console with "custom_args" (works if i remove custom_args)

	def sendgrid_test(to_email)
		mail(:to => to_email, :subject => "Test", custom_args: {campaign: 'welcome'}) do |format|
			format.text { render :plain => "Test message" }
		end
	end
irb(main):027:0> ApplicationMailer.sendgrid_test("[email protected]").deliver_now
  Rendering text template
  Rendered text template (0.1ms)
ApplicationMailer#sendgrid_test: processed outbound mail in 22.7ms
Sent mail to [email protected] (8.9ms)
Date: Wed, 16 Feb 2022 18:45:23 +0800
From: XXX <[email protected]>
To: [email protected]
Message-ID: <[email protected]>
Subject: Test
Mime-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit
custom-args: {:campaign=>"welcome"}
X-SMTPAPI: {"category":"dev","filters":{"clicktrack":{"settings":{"enable":0}}}}

Test message
NoMethodError: undefined method 'unparsed_value' for #<Mail::OptionalField:0x007fbc2ad7b318>
	from (irb):27

Rails 5.1.6
ruby 2.3.1p112
sendgrid-actionmailer-3.2.0

from sendgrid-actionmailer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.