Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethodError: undefined method `unparsed_value' for #<Mail::OptionalField:0x007fbc2ad7b318> #113

Open
mountriv99 opened this issue Feb 22, 2022 · 1 comment

Comments

@mountriv99
Copy link

Hi I think this is related to issue #99

OP was using "personalizations" and I'm using "custom_args" (works if i remove custom_args)

Still having this error in Rails 5

Rails 5.1.6
ruby 2.3.1p112
sendgrid-actionmailer-3.2.0

	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("xxx@xxx.com").deliver_now
  Rendering text template
  Rendered text template (0.1ms)
ApplicationMailer#sendgrid_test: processed outbound mail in 22.7ms
Sent mail to xxx@xxx.com (8.9ms)
Date: Wed, 16 Feb 2022 18:45:23 +0800
From: XXX <no-reply@xxx.com>
To: xxx@xxx.com
Message-ID: <620cd5c3142c2_e78c3fde1243193c94884@MacBook-Air-2.local.mail>
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
@mountriv99
Copy link
Author

Update: works if i downgrade to 3.1.1

I suspect it's caused by this commit
271de1c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant