Skip to content

ISO8859-1 characters in subject #204

Open
@dturriaga

Description

@dturriaga

I read that only are supported UTF8 characters without RFC 2047...

How can I write in the subject words with vowels with tíldes and ñ?

All the sources of the project are in ISO8859-1, so when preparing the email I do:

	...
	$httpClient = new GuzzleAdapter(new Client());
	$sparky = new SparkPost($httpClient, ['key'=>"1234567890abcdef1234567890abcdef12345678"]);
	$promise = $sparky->transmissions->post([
	    'content' => [
			'from' => ['name' => $from_name, 'email' => $from_email],
			'subject' => utf8_encode($subject),
			'html' => utf8_encode($html),
			'text' => '{{user}}: html not supported',
	    ],
	    'substitution_data' => ['user' => $user],
	    'recipients' => [
	        [
	            'address' => ['name' => $user, 'email' => $email],
	        ],
	    ],
	]);

but latin1 characters in then subject display wrong
and, if I dont use utf8_encode on subject, I have an exception.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dturriaga

        Issue actions

          ISO8859-1 characters in subject · Issue #204 · SparkPost/php-sparkpost