-
Notifications
You must be signed in to change notification settings - Fork 625
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
Name part in setFrom is wrapped in double quotes twice #897
Comments
See #368
|
Yep problem is that it is wrapped twice in double quotes, so instead of name resulting in: |
I took out the changes made in #511 and emails send fine. Checking to see if/when this was fixed on the back-end before committing to submitting a PR to revert the changes. |
After checking with support turns out the original bug does not impact all customers/traffic, so I'm hesitant to take the double-quote wrapping fix out. Another option is to make this configurable in the client so that you can make adjustments if you know it's going to impact you or not. I'll circle back here if it ever gets completely fixed on the backend so this code can be ripped out, but open to reviewing a PR if anyone wants to implements the option above. |
The original ticket that introduced this bug (#368) acknowledges that this is an API bug that only applies to V3, and @thinkingserious says that it is being fixed at the API level (but hadn't yet been, when 368 was being worked on). Nowhere on #368, #370 or #511 do I see any mention of these quotes showing up in users email clients. I'd therefore suggest that at some point between those tickets being worked on and this ticket being filed that the underlying API bug was fixed, and this workaround should be reverted. @childish-sambino Do you have any more information about which customers it does / does not impact? Is there a public bug report for the API-level bug? The response from support sounds like someone a support team might say if they knew that had seen a bug previously but couldn't reproduce it and hadn't been told it had been fixed. |
Issue Summary
Name part in setFrom is wrapped in double quotes twice, which results in incorrect From header and iOS Mail app not displaying from name properly.
Steps to Reproduce
Copy/paste Hello Email use case from here:
https://github.com/sendgrid/sendgrid-php
and replace this line:
$email->setFrom("[email protected]", "Example User");
with this:
$email->setFrom("[email protected]", "Text, With, Commas");
and output JSON before send call to see request body:
echo json_encode($email, JSON_PRETTY_PRINT);
and you'll get following:
If you update emails and API key and send this out, this will result in From header name part like this:
From: "\"Text, With, Commas\""
And iOS Mail app will render that as attached.
Technical details:
The text was updated successfully, but these errors were encountered: