verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
95 stars 73 forks source link

Error during Form Synchronization with Campaign Plugin: API Error on Newsletter Subscription #2037

Open alexanderbuergin opened 2 months ago

alexanderbuergin commented 2 months ago

Describe the bug

Error during Form Synchronization with Campaign Plugin: API Error on Newsletter Subscription

Description:

We are encountering an issue when a form is synchronized with the Campaign Plugin. The newsletter subscription is not being correctly passed to the plugin, leading to an API error.

Error Message:

Failed
API Error: "putyourlightson\campaign\services\FormsService::createAndSubscribeContact(): Argument #1 ($email) must be of type string, null given, called in /home/wiqusaha/public_html/jcb/vendor/verbb/formie/src/integrations/emailmarketing/Campaign.php on line 158"
/home/wiqusaha/public_html/jcb/vendor/putyourlightson/craft-campaign/src/services/FormsService.php:153

It appears that the error occurs because the $email argument is being passed as null instead of a string, as expected. This happens when the form tries to create a contact and subscribe them to the newsletter.

Steps to reproduce

Expected Behavior:

The email address should be correctly passed to the Campaign Plugin so that the newsletter subscription can be completed without errors.

Form settings

Versions

Craft CMS: 5.3.2 Formie: 3.0.1 Campaign: 3.4.2

alexanderbuergin commented 2 months ago

@bencroker: Maybe relevant.

Thanks.

engram-design commented 2 months ago

Seems to be all working okay on my end, sorry. Looks like there's not a value for the email? If it's saying that it's null, sounds like something is going on, as that should never happen being a required mapping field.