SparkPost / wordpress-sparkpost

WordPress plugin to use SparkPost email
https://wordpress.org/plugins/sparkpost/
20 stars 15 forks source link

Emails could not be sent. htmlentities() expects parameter 1 to be string, array given in xxx #143

Open xrobrobx opened 6 years ago

xrobrobx commented 6 years ago

Debug Messages Preparing request data Request headers: Array( [User-Agent] => wordpress-sparkpost/3.2.0 [Content-Type] => application/json [Authorization] => xxxx****) Request body: {"recipients":[{"address":{"email":"some@email.com","header_to":"some@email.com"}}],"options":{"open_tracking":true,"click_tracking":true,"transactional":true},"content":{"template_id":"general"},"substitution_data":{"content":"

Hurray!!<\/h3>

You've got mail! <br\/>
Regards,<br\/><a href=\"https:\/\/www.sparkpost.com\">SparkPost<\/a> WordPress plugin<\/p>","subject":"SparkPost email test","from_name":"My Name","from":"support@email.com","from_localpart":"support"}} Making HTTP POST request to https://api.sparkpost.com/api/v1/transmissions Response received Request completed with error

Warning: htmlentities() expects parameter 1 to be string, array given in /home/xxx/public_html/xxx.com/wp-includes/class-phpmailer.php on line 732

I've been getting this when sending any test emails and any emails sent through SparkPost as of Mar 11, 12AM.

Nothing was changed and I am wondering could be causing this issue?

rajumsys commented 6 years ago

Can you please report this

are you getting this all of a sudden (i mean were it working earlier but not getting this) or you're getting it since installation.

xrobrobx commented 6 years ago

WordPress version -> 4.9.5 phpMailer version -> 5.2.22 SparkPost plugin version -> 3.2.0

It appears to be working again now. I am not sure why it suddenly jumped back and forth between working or not as nothing was done to modify the ways the emails are sent.

rajumsys commented 6 years ago

Did you enable/disable any other plugins/themes in between?

xrobrobx commented 6 years ago

I only switched between HTTP API and SMTP. SMTP seems to be fine but no templates can be used, but switching over to the HTTP API always gave me that error.

Last night it started working again after giving that error for 1-2 days.

xrobrobx commented 6 years ago

Okay, it worked for a day or two and does the same thing, nothing was changed.

I think SparkPost is changing something on their end? I'm not certain why it is works intermittently for a day or two before doing the thing, same error.

rajumsys commented 6 years ago

Did you enable email logging? can you inspect the request and response sections to see any differences in either one?

xrobrobx commented 6 years ago

How do I enable email logging? I only see the debug checkbox for the error messages

rajumsys commented 6 years ago

From overrides tab