Comments (3)
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.
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.
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)
- Testing in development with letter_opener? HOT 3
- Renaming master branch to main HOT 1
- Migrate off Travis CI HOT 1
- Actionmailer test helper not working with sandbox HOT 1
- How do I send attachments?
- NoMethodError: undefined method `unparsed_value' for #<Mail::OptionalField:0x007fbc2ad7b318> HOT 1
- Having troubles with attachments
- Setup global retry using mail settings
- Error message: A JSON text must at least contain two octets! HOT 3
- Release tags after v2.6.0 are missing or are inconsistent HOT 1
- Git tags are missing or inconsistent HOT 1
- Does not load when Rails inflection has been set for 'SendGrid' HOT 4
- asm parameter does not work HOT 2
- How do I enable sandbox mode in environment file? HOT 3
- Not attaching files HOT 2
- emails not delivered - 400 bad request HOT 1
- Bcc extension for multiple addresses HOT 1
- Feature request: Make it possible to config request timeout HOT 2
- Clarify how to test HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sendgrid-actionmailer.