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

JSON quoted comma not ignored #578

Closed
codeFarmerJ opened this issue May 30, 2018 · 10 comments
Closed

JSON quoted comma not ignored #578

codeFarmerJ opened this issue May 30, 2018 · 10 comments
Labels
difficulty: medium fix is medium in difficulty status: work in progress Twilio or the community is in the process of implementing type: community enhancement feature request not on Twilio's roadmap

Comments

@codeFarmerJ
Copy link

codeFarmerJ commented May 30, 2018

Issue Summary

I'm using a python script to send emails. It mostly works. Comma embedded in quotes are causing the submission to fail.

Steps to Reproduce

The input is a CSV file.

"Joe User",[email protected],54321
"User, Joe",[email protected],55555
The second line fails.

Python correctly parses the line and formats it as JSON, but it fails on submission. Apparently the quotes on name field are ignored and sees the embedded comma as a delimiter. It then uses User as the name and Joe as the email address and fails.

Is this a known bug? Is there a work-around?

Technical details:

  • sendgrid-python 5.3.0
  • Python Version: 2.7.3
@codeFarmerJ codeFarmerJ changed the title JSON quoted comma not ignore JSON quoted comma not ignored May 30, 2018
@thinkingserious
Copy link
Contributor

Hello @codeFarmerJ,

Yes, this is a known bug at the API level and a workaround has not been added to this SDK yet. However, we do have a workaround implemented in our PHP SDK that should help.

I'll leave this issue open so that we can get that patch implemented here also.

Thanks!

With Best Regards,

Elmer

@thinkingserious thinkingserious added type: community enhancement feature request not on Twilio's roadmap status: help wanted requesting help from the community difficulty: easy fix is easy in difficulty up-for-grabs labels May 31, 2018
@thinkingserious thinkingserious added difficulty: medium fix is medium in difficulty status: work in progress Twilio or the community is in the process of implementing hacktoberfest and removed difficulty: easy fix is easy in difficulty help wanted status: help wanted requesting help from the community labels Oct 2, 2018
@shubhambhattar
Copy link

I would like to try to solve this. Any idea where should I start (which files should I focus on)?

@cmccandless
Copy link
Contributor

cmccandless commented Oct 6, 2018

This was raised resolved in #618

@shubhambhattar
Copy link

@cmccandless So the issue is resolved?

@cmccandless
Copy link
Contributor

@shubhambhattar yes, that is what I intended to say. Apologies for the typo.

@cmccandless
Copy link
Contributor

Note: it was requested that #618 be targeted at the v4 branch instead of the master branch, so the issue keywords did not close this issue. It is probable that when v4 is merged with master, this issue will automatically be closed.

@shubhambhattar
Copy link

@cmccandless Okay. Thanks for the clarification.

@cmccandless
Copy link
Contributor

Also, possible duplicate of #291

@medmunds
Copy link

Yes, this is the same underlying "commas in recipient display names" API problem as #291, and is not actually related to CSV files or JSON. More info and outline for a fix is in this comment.

Just a heads up that the code merged in #618 likely injects a couple of new issues:

  • It adds unnecessary quotes around display names in the From and Reply-To headers, which will be displayed to recipients in most email clients. (So From: Widgets, Inc. will show up as From: "Widgets, Inc." in Gmail after the fix.) This is probably minor, but it's a change from current behavior. And I suppose there's a chance these look like scare quotes when users see them alongside other messages that don't wrap the sender name in extra quotes.

  • It calls html.unescape on all email display names. I'm not sure what this was meant to do—HTML entities are not relevant to email headers. It's probably harmless for most real-world names, but could cause unexpected behavior for certain names containing & and ;. (Maybe the intent was something like email.utils.quote?)

@thinkingserious
Copy link
Contributor

Since there has been no activity on this issue since March 1, 2020, we are closing this issue. Please feel free to reopen or create a new issue if you still require assistance. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium fix is medium in difficulty status: work in progress Twilio or the community is in the process of implementing type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

No branches or pull requests

6 participants