Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alexanderbuergin opened this issue Aug 25, 2024 · 2 comments

Comments

@alexanderbuergin
Copy link

alexanderbuergin commented Aug 25, 2024

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

  • A form is used to process a newsletter subscription.
  • The form is synchronized with the Campaign Plugin.
  • The API error described above is triggered during the processing.

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

  • Multi-page form: No
  • Submission Method: Page Reload
  • Client-side Validation: Yes
  • Custom Form Templates: No

Versions

Craft CMS: 5.3.2
Formie: 3.0.1
Campaign: 3.4.2

@alexanderbuergin
Copy link
Author

@bencroker: Maybe relevant.

Thanks.

@engram-design
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants