PHP SDK Compatiblity with PHP 7

Hi there:

I set up a Constant Contact integration for our website using the PHP SDK adapted from the sample code for the email signup form (https://github.com/constantcontact/php-sdk/blob/development/examples/addOrUpdateContact.php). We recently upgraded our server to PHP 7.2.12 and have been receiving the following error:

 

Fatal error: Cannot use lexical variable $eventName as a parameter name in /nfs/c04/h02/mnt/67435/domains/mysticchorale.org/html/wp-content/themes/mc/constant_contact_library/vendor/guzzlehttp/guzzle/src/Event/Emitter.php on line 48

 

Is there any way of updating the PHP SDK files to address this error and make the library usable with PHP 7?

 

If the library is not compatible is there an equivalent example you can provide similar to the sample code I linked above for a sign up form that would be compatible with V3 of the API? I did briefly review the V3 documentation and was confused, I don't understand how to duplicate the functionality I was able to set up using the PHP SDK with V2 in V3 of the API.

 

Without going into detail the Constant Contact integration on our site is more complicated than a simple sign up form. The integration is handled as part of a larger member registration process which triggers list updates in a few different circumstances (including being initiated by the purchase of a product in WooCommerce).

 

Hope all of the above makes sense. Please get back to me when you have a chance. I need to have a solution in place for this by Monday December 2nd. Thanks for your help!

-Robert

Leaderboard