- 
                Notifications
    You must be signed in to change notification settings 
- Fork 97
Open
Description
SparkPost SDK version: 2.3.0
Error: {"error":"{"errors":[{"message":"content.from and content.name must sum to an even number of nested quote(s)","code":"1902"}]}","code":422,"body":{"errors":[{"message":"content.from and content.name must sum to an even number of nested quote(s)","code":"1902"}]}
Example code:
If $name contains double quote, we get the above error. As a user of the library, I believe SparkPost should be able to handle the below scenario and escape the name correctly because otherwise I need to dive into SDK code to confirm that my escaping method is compliant with the SDK.
$name = 'Chef"s Kitchen';
$this->mailer->transmissions->post([
                'campaign_id' => $options['campaign_id'] ?? null,
                'options' => [
                    'transactional' => true,
                    'click_tracking' => false,
                    'perform_substitutions' => false,
                ],
                'return_path' => $this->getReturnPath($sender->address),
                'content' => [
                    'from' => [
                        'email' => $sender->address,
                        'name' => $name,
                    ],
...Metadata
Metadata
Assignees
Labels
No labels