wordpress-sparkpost icon indicating copy to clipboard operation
wordpress-sparkpost copied to clipboard

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

Open xrobrobx opened this issue 7 years ago • 8 comments

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":"[email protected]","header_to":"[email protected]"}}],"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":"[email protected]","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?

xrobrobx avatar May 12 '18 04:05 xrobrobx

Can you please report this

  • WordPress version
  • phpMailer version
  • SparkPost plugin version

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.

rajumsys avatar May 14 '18 14:05 rajumsys

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.

xrobrobx avatar May 14 '18 17:05 xrobrobx

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

rajumsys avatar May 14 '18 17:05 rajumsys

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 avatar May 14 '18 17:05 xrobrobx

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.

xrobrobx avatar May 16 '18 21:05 xrobrobx

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

rajumsys avatar May 16 '18 21:05 rajumsys

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

xrobrobx avatar May 16 '18 21:05 xrobrobx

From overrides tab

rajumsys avatar May 17 '18 07:05 rajumsys