Created
October 26, 2018 18:21
-
-
Save rwkyyy/88fe965f8815b381615208657b458b4b to your computer and use it in GitHub Desktop.
cf7 dom event + jquery.post for sending data to external api via URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener( 'wpcf7mailsent', function( event ) { | |
var name = jQuery("input[name=your-name]").val(); | |
var email = jQuery("input[name=your-email]").val(); | |
var phone = jQuery("input[name=tel-151]").val(); | |
var date = jQuery("input[name=date-146]").val(); | |
var msg = jQuery("textarea[name=your-message]").val(); | |
jQuery.post ('http:/url.tld?' + 'username=static_value' + '&password=static_value' + '&source=static_value' + '&clientName=' + name + '&clientEmail=' + email + '&clientPhone=' + phone + '&programmingDate=' + date + '&message=' + msg );}, false ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment