Sending data directly

The Send2CRM client provides functionality to take data from HTML forms, but also allows sending submissions directly. This is useful for sending any data that does not directly use a form, or where the form is too complex for automatic processing.

let formData = { firstName: 'John', lastName: 'Smith', email: 'johnsmith@example.com', }; send2crm.forms.send('UNIQUE_FORM_ID', formData) .then((data) => { // Successful response. }) .catch((error) => { // Failed :-( });

The return value for successful sends is the same as supplied to form events, but with the values property removed. If the visitor was successfully identified, a visitorId property will also be set.

{ "isSuccess": true, "error": "", "visitorId": "" }