-
Notifications
You must be signed in to change notification settings - Fork 409
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
To, ToName and Substitution values getting jumbled. #61
Comments
Do not use spaces inside your substitution tags, e.g. %first name% On Thursday, February 26, 2015, gs-spadmanabhan [email protected]
Yamil Asusta |
As you can see in the above curl request I am not using any spaces in Substitution tag (key name). In the request the key is "there" and values i am replacing with a text content which has space. Is that a problem? |
I could see in the mail TO section, the to and to names are getting jumbled. AS for the substitution is concerned it doesn't have any problem. |
https://sendgrid.com/docs/API_Reference/SMTP_API/substitution_tags.html Spaces are not allowed inside the values of the sub tags. The request will get messed up. |
I tried without spaces in the values of sub tags as well. Please try it once from your end and let me know. I have forked your project and made the changes in buildEmailBody(Email) it seems to be working fine now. I can send you the pull request. |
I'm also having an issue with the to[] and toname[] values getting jumbled. For example, the actual POST request that is generated by this library has the following segment:
However, the actual email that I receive on the other end has: This doesn't appear to be an issue with the sendgrid-java library, but rather something within SendGrid that is jumbling up the to and toname arrays. This may not be the best place to report it, but can someone forward it to the right party? |
Do not fill values inside to[] and toname[] while framing post request body for sendgrid mail api. It will work as expected. |
It's a bug in the library. I have forked the project and I have made Thanks & Regards, “You have absolutely no idea how glad I am that I have no idea at all.” On Fri, Mar 27, 2015 at 10:21 PM, Alex Leigh [email protected]
|
Ah I see what you mean now, thanks. Could you tell me which commit in your fork contains the fix? |
I will check-in my changes and let you know. |
Here is the commit id, |
Would love it if you could create a PR with your changes! We'll get them tested and merged as soon as we can! |
Just created a pull request, please check. Thanks! |
Is there an update for this to get into the api as a fix? |
I have submitted the pull request long back, still waiting for updates on the same. |
Sorry for the delay. The fix was merged and uploaded to maven central under v2.2.2 |
Hi,
Currently the curl command which is getting framed by this framework is something like this
api_user=XXXXXX&api_key=XXXXXX&to[0]=[email protected]&to[1]=[email protected]&to[2]= [email protected]&toname[1]=sunand&toname[2]=sp&toname[3]=samosa&x-smtpapi={"sub":{"there":["Sunand Online","SP","Samosa Chat"]}}&subject=Hello there&text=Hi there&html=Hi there, How are you?&from=[email protected]
This is wrong, this is getting re-ordered at the sendgrid end it sends wrong Substitution values to recipients and also sets incorrect to and toname combination
The correct one is below, we should not specify to[1] and toname[1]
api_user=XXXXXX&api_key=XXXXXX&to[]=[email protected]&to[]=[email protected]&to[]= [email protected]&toname[]=sunand&toname[]=sp&toname[]=samosa&x-smtpapi={"sub":{"there":["Sunand Online","SP","Samosa Chat"]}}&subject=Hello there&text=Hi there&html=Hi there, How are you?&from=[email protected]
This should be fixed in buildingEmailBody.
The text was updated successfully, but these errors were encountered: