I am having an issue with the PHP SDK I have been unable to resolve. Without going into detail our site is a Word Press site which allows members to register with the site (creating a Word Press user with a custom role). When members register I am using the PHP SDK to add them to the selected mailing list. I set up a function in my functions file (functions.php) to process the constant contact integration. This function is called mc_update_constant_contact which takes 6 arguments: action (whether member is being added or dropped, first name, last name, email, season id (id of the season they are registering for), and new member (boolean whether the member is a new member). When setting up and testing the function I was able to successfully run it by calling the function directly from a page template. Everything worked correctly and the Constant Contact lists were updated accordingly. However when attempting to run the function as part of the registration form the Constant Contact integration fails. Without getting into detail the registration form uses the Theme My Login and I integrated my Constant Contact function into the function which processes the submission when the registration form is submitted. The registration form runs successfully and the member is added, however the mailing list integration fails. Here is the PHP error message I receive on failure: Uncaught exception 'Ctct\Exceptions\CtctException' with message 'Bad Request' in /Users/trebor/Documents/Sites/wordpress/mc/wp-content/themes/mc/constant_contact_library/vendor/constantcontact/constantcontact/src/Ctct/Services/BaseService.php:78 Stack trace: #0 /Users/trebor/Documents/Sites/wordpress/mc/wp-content/themes/mc/constant_contact_library/vendor/constantcontact/constantcontact/src/Ctct/Services/ContactService.php(203): Ctct\Services\BaseService->convertException(Object(GuzzleHttp\Exception\ClientException)) #1 /Users/trebor/Documents/Sites/wordpress/mc/wp-content/themes/mc/functions.php(1897): Ctct\Services\ContactService->updateContact('ddd578d4-f03e-4...', Object(Ctct\Components\Contacts\Contact)) #2 /Users/trebor/Documents/Sites/wordpress/mc/wp-content/themes/mc/functions.php(1465): mc_update_constant_contact('add', 'Robert', 'Tokey', 'robert.tobey@co...', '2165', true) #3 /Users/trebor/Documents/Sites/wordpress/mc/wp-content/themes/mc/functions.php(1237): mc_create_season_registration('Robert', in /Users/trebor/Documents/Sites/wordpress/mc/wp-content/themes/mc/constant_contact_library/vendor/constantcontact/constantcontact/src/Ctct/Services/BaseService.php on line 78 Any ideas on what could be going wrong? I am thinking there is likely an error with where I am placing the require statements for the auto loader script and the use statements for the associated classes. Completely stumped and this is driving me nuts. I can provide more details if needed, hope the above makes sense.
... View more