getfluid
3/9/2018 - 7:48 PM

Contact Form 7 - Act-On Integration

Send Contact Form 7 to Act-On via AJAX

$(document).on('wpcf7mailsent', function() {
  // Select the form with jQuery and serialize the input fiels
  let formData = $('.wpcf7-form').serialize()

  // Get a Form Post URL from Act-On dashboard
  let actonUrl = 'ACTON_POST_FORM_URL_GOES_HERE'

  // Submit the request with Ajax.
  $.ajax({
    url: actonUrl,
    type: 'POST',
    data: formData
  })
  .done(function() {
    console.log('submitted to acton');
  })
  .fail(function() {
    console.error('could not submit to acton');
  })
});