MODX Community

Mailchimp for FormIt with -Login / Regiter - Extra

Hello, I’m having a small problem using the Mailchimp for FormIt extra.
I’m using it with [[!Register? snippet from the Login Extra.
this is my call:

[[!Register?
    &preHooks=`MailChimpSubscribe,imageUpload,dobToUnix`
...
    &mailchimpListId=`idHere`
    &mailchimpSubscribeStatus=`subscribed`
    &mailchimpTags=`taghere`
    &mailchimpSubscribeField=`newsgroup`
    &mailchimpSubscribeFieldValue=`yes`
    &mailchimpFields=`fullname=FNAME,surname=LNAME,email=EMAIL`
...]]

HTML:

                <p class="text-center w-100">
                    <label for="newsgroup" class="checkbox">
                        <input type="checkbox" id="newsgroup" name="newsgroup" value="yes" />
                        <i class="fas fa-check"></i>
                    </label> [[%register.agreeMarketing]].
                    [[!fi.error.mailchimp]]
                </p> 

But I’m receiving this error on submit.

The scriptproperty mailchimpFields was not found, please configure the merge tags using this scriptproperty.

Don’t undersatand why, mailchimpFields existi in the snippet properties.
Any ideas please?

Thanks!

Perhaps a typo or missing bracket/backtick in the part of the register call you’ve cut out of the snippet you posted?

I had been successfully using the first version of this snippet with the [[!Register? snippet on a fairly complex form. When I upgraded to the latest version the mailchimp subscription stopped working. I tested it on a very basic form and found that with [[!Register? it simply does not work. you have to use [[!Formit?.

I tried using

[[!Formit?
&element=`Register`

I also tried

[[!Register?
&element=`Formit`

But neither of the above worked. (This may have been a daft idea).

So I am back using the first version for the moment. If you do manage to get it working I would be interested to know the solution.

Mark here is the whole thing.
the form is quite big.

[[!Register?
    &preHooks=`MailChimpSubscribe,imageUpload,dobToUnix`
    &submitVar=`registerbtn`
    &activationResourceId=`14`
    &activation=`1`
    &activationEmailTpl=`activationEmail.tpl`
    &activationEmailSubject=`[[++site_name]] - [[%thanks_required? &namespace=`login` &topic=`register`]]!`
    &submittedResourceId=`13`
    &usergroups=`membersOnly:Member`

    &mailchimpListId=`xxxxxxxxx`
    &mailchimpSubscribeStatus=`subscribed`
    &mailchimpTags=`training.webmail`
    &mailchimpSubscribeField=`newsgroup`
    &mailchimpSubscribeFieldValue=`yes`
    &mailchimpFields=`fullname=FNAME,surname=LNAME,email=EMAIL`

    &customValidators=`customUsernameValidate,customNameValidate`
    &validate=`nospam:blank,
        username:required:minLength=^4^:maxLength=^15^:strip=^ ^:customUsernameValidate,
        password:required:minLength=^6^,
        password_confirm:password_confirm=^password^,
        fullname:required:customNameValidate,
        email:required:email,
        country:required,
        dob:required:isDate=^%d-%m-%Y^,
        gender:required,
        address1:required,
        city:required,
        postcode:required,
    `
    &vTextRequired=`[[%field_required? &namespace=`core` &topic=`default`]].`
    &dob.vTextRequired=`dd-mm-yyyy (31-12-1991).`
    &placeholderPrefix=`reg.`
]]

If I delete the preHook: MailChimpSubscribe the form works fine!

Any help please? this is annoying!!! :confused:

MailChimpSubscribe is a regular (post) hook, not a prehook. Add it to &hooks instead of &preHooks.

Thanks for your answer Mark.
Mate the solution at the end was make it manually. The extra has a problem working with the registration form.

thank you anyway!