top of page

Notes:

​

Button submitt code

​

import wixCRM from 'wix-crm';

 

$w.onReady(function () {

 

});

 

export function button1_click(event, $w) {

    wixCRM.createContact({

        "First Name": $w("#input1").value,

        "Emails": [$w("#input14").value],

        "Last Name": $w("#input2").value,

        "Phone": $w("#input15").value,

        "Street": $w("input8").value,

        "City": $w("input10").value,

        "Zip": $w('#input15').value,

        "Country": $w('#input13').value,

    })

    .then((contactId) => {

    wixCRM.emailContact("Verify", contactId, {

        variables: {

            subscribername: $w('#input1').value,

            }

        })

        .then(() => {

        // do something after the email was sent

     })

    .catch((err) => {

        // handle the error if the email wasn't sent

    });

    });

}

​

//The form will save the captured data to a database table 'Users' and then create a new user in the CRM.

//It will read the user ID and send an email to verify the email.

//It is triggered by the submitt button called #button1

import wixCRM from 'wix-crm';

$w.onReady(function () {

});

 

export function button1_click(event, $w) {

//create an entry in the Wix CRM so that the user has a crm ID

//capture as many fields to write into the CRM as possible - will save synching of contacts to database

wixCRM.createContact({

firstName: $w('#input1').value,

lastName: $w("#input2").value,

emails: [$w('#input14').value]

//"Phone": $w("#input15").value,

//"Street": $w("#input8").value,

//"City": $w("#input10").value,

//"Zip": $w('#input15').value,

//"Country": $w('#input13').value,

})

.then((contactId) => {

wixCRM.emailContact('Verify', contactId, {

variables: {

subscribername: $w('#input1').value,

}

})

.then(() => {

// do something after the email was sent

console.log()

})

.catch((err) => {

// handle the error if the email wasn't sent

});

});

 

}

​

Notes:

​

given_name:

"tyuuu"

surname:

"uuuuuu"

middle_name:

""

streetAddress:

"uuuuuuuu"

city:

"uuu"

post_code:

2077

country:

"Australia"

email_pref:

"ross@famyelland.net"

mobile:

438765455

home_num:

""

password:

"909-098-0898jjkh"

newsletters:

true

over_18:

true

title:

"Mr"

state:

"NSW"

_id:

"bd121189-4d5e-47cd-8c5a-0e105f23f441"

_owner:

"4a9f315d-7f81-4fe8-b547-ad09b8d6e5ef"

_createdDate:

"2018-09-28T23:39:24.394Z"

_updatedDate:

"2018-09-28T

bottom of page