Skip to content

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

@mountriv99

Description

@mountriv99

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("[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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions