Your software
My Mautic version is: 4.2.2
My PHP version is: 7.4.30
My Database type and version is: 10.6.10-MariaDB
Your problem
My problem is:
Hi guys all right? good how can i use this formula below to send to my mautic?
<style>
.banner-joinnow-form { display: block !important; background-color: transparent !important; padding: 0px 8px 8px 8px !important; }
.banner-joinnow-form .form-row { margin: auto !important; background-color: transparent !important; padding: 7px 0 !important; }
.banner-joinnow-form input { background-color: #fff !important; height: 40px !important; width: 50% !important; margin-top: 10px !important; }
.banner-joinnow-form .wpcf7-form-control-wrap { height: 40px !important; }
.banner-joinnow-form input[type="submit"] { line-height: 0 !important; text-align: center !important; height: 50px !important; width: 100% !important; margin-top: 15px !important; border-radius: 1px !important; background-color: #fcb94b !important; font-size: 20px !important; font-weight: bold !important; text-transform: none !important; }
.banner-joinnow-form input[type="submit"]:hover { background-color: #e18d03 !important; }
.banner-joinnow-form input[type="email"], .banner-joinnow-form input[type="number"] { width: 242px !important; border-right: 0px !important; margin-bottom: 0 !important; margin-top: 10px !important; }
.banner-joinnow-form input[type="text"] { width: 242px !important; }
#signup-form .forms-response-msg:not(:empty), #signup-form #success-wrap, #signup-form #error-wrap { text-align: center; color: #fff; font-size: 15px; margin: 0; padding: 0; font-weight: bold; font-size: 14px; }
#signup-form #errors { margin-left: 20px; }
#signup-form #error-wrap h3, #signup-form #success-wrap h2, #signup-form #success-wrap h3 { color: #ffffff; }
#signup-form #success-wrap p, #signup-form #error-wrap p { text-align: center !important; color: #fff; }
#signup-form #success-wrap .news-signup-text { font-weight: normal; }
.grecaptcha-badge { visibility: hidden !important; }
/* mobile */
@media (max-width: 639px) {
.banner-joinnow-form { width: 100%; }
.banner-joinnow-form .form-row { padding: 0px !important; }
.banner-joinnow-form .wpcf7-form-control-wrap { height: auto !important; }
.banner-joinnow-form .form-row .col-auto { margin: auto !important; width: 100% !important; }
.banner-joinnow-form input[type="text"], .banner-joinnow-form input[type="email"] { width: 100% !important; margin: auto !important; margin-top: 10px !important; }
}
@media (max-width: 320px) {
.banner-joinnow-form input[type="email"], .banner-joinnow-form input[type="text"] { height: 30px !important; }
}
</style>
<div role="form" class="wpcf7" id="wpcf7-f809-p294-o1" dir="ltr">
<div class="screen-reader-response" aria-live="polite"></div>
<form id="signup-form" action="#" method="post" class="wpcf7-form" novalidate="novalidate">
<div id="success-wrap" style="display: none">
<p>Obrigado por se cadastrar!</p>
</div>
<div id="error-wrap" style="display: none">
<div class="list-wrapper">
<ul class="errors"></ul>
</div>
</div>
<div id="errors" class="forms-response-msg"></div>
<div class="banner-joinnow-form form-wrapper">
<div class="form-row">
<div class="col-auto">
<span class="wpcf7-form-control-wrap name">
<input type="text" name="name" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required wpcf7-validates-as-email form-control" aria-required="true" aria-invalid="false" placeholder="Seu nome">
</span>
</div>
<div class="col-auto">
<span class="wpcf7-form-control-wrap email"><input type="email" name="email" value="" size="40" class="form-control wpcf7-form-control wpcf7-text wpcf7-email wpcf7-validates-as-required wpcf7-validates-as-email" aria-required="true" aria-invalid="false" placeholder="Email"></span>
</div>
</div>
<div class="form-row">
<div class="col-auto">
<span class="wpcf7-form-control-wrap phone"><input id="phone" type="text" name="phone" value="" size="40" class="form-control wpcf7-form-control wpcf7-text wpcf7-tel wpcf7-validates-as-required wpcf7-validates-as-tel" aria-required="true" aria-invalid="false" placeholder="Celular"></span>
</div>
<div class="col-auto">
<span class="wpcf7-form-control-wrap postalCode"><input id="postalCode" type="text" name="postalCode" value="" size="40" class="form-control wpcf7-form-control wpcf7-text wpcf7-validates-as-required" aria-required="true" aria-invalid="false" placeholder="CEP"></span>
</div>
</div>
<input id="recaptcha-submit" type="submit" value="Quero fazer parte!" class="wpcf7-form-control wpcf7-submit btn btn-primary"><span class="ajax-loader"></span>
<input type="hidden" name="country" value="BR" class="wpcf7-form-control wpcf7-hidden"/>
<input type="hidden" name="origin" value="6e6efc61-205f-469a-bf3d-1bdb0a6407e8" class="wpcf7-form-control wpcf7-hidden"/>
<input type="hidden" name="organization" value="604eeaf7-139b-4250-addf-b502cecdfc69" class="wpcf7-form-control wpcf7-hidden"/>
<input type="hidden" name="tags" value="aac07cb5-02ae-4159-b7c9-a74cabe3d816" />
<div class="g-recaptcha" data-sitekey="#######################" data-size="invisible" data-callback="onSubmit"></div>
</div>
<div class="wpcf7-response-output wpcf7-display-none" aria-hidden="true"></div>
</form>
</div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.16.0/jquery.validate.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.15/jquery.mask.min.js'></script>
<script src='https://www.google.com/recaptcha/api.js' async defer></script>
<script>
$ = jQuery;
jQuery(document).ready(function () {
$.fn.serializeFormJSON = function () {
var o = {};
var a = this.serializeArray();
$.each(a, function () {
if (o[this.name]) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
} else {
o[this.name] = this.value || '';
}
});
return o;
};
$('#phone').mask('(99) 9999-99990');
$('#postalCode').mask('99999-999');
$('.cf7mls_next, .cf7mls_back').click(function(event) {
if ($('#signup-form').valid()) {
$('.form-step, .cf7mls_next').toggle();
$("#error-wrap").hide();
}
});
$('#signup-form, .cf7mls_next').validate({
onkeyup: false,
errorElement: 'div',
ignore: ":hidden:not(.force-validation)",
errorPlacement: function (error, element) {
error.appendTo($("#errors"));
},
highlight: function (element, errorClass) {
$('#' + $(element).attr('name') + '-error').remove();
},
unhighlight: function (element) {
$('#' + $(element).attr('name') + '-error').remove();
$('#error-wrap').fadeOut(300);
},
rules: {
email: {required: true, email: true},
name: {required: true, minlength: 2},
postalCode: {required: true, minlength: 9, maxlength: 9},
phone: {required: true, maxlength: 15}
},
messages: {
email: "Preencha o campo com um email válido",
name: "Preencha o campo com um nome válido",
postalCode: "Preencha o campo com um CEP válido",
phone: "Preencha o campo com um telefone válido"
},
});
$body = $("body");
$(document)
.ajaxStart(function () { $body.addClass("loading"); })
.ajaxStop(function () { $body.removeClass("loading"); });
$("#recaptcha-submit").on("click", function (event) {
if ($('#signup-form').valid()) {
grecaptcha.execute();
}
return false;
});
});
function onSubmitError(response) {
grecaptcha.reset();
$("#error-wrap li").remove();
$("#error-wrap").show();
if (response) {
if (response.messages) {
$.each(response.messages, function (index, message) {
var msg = document.createElement("li");
msg.innerHTML = message;
$("#error-wrap ul").append(msg);
});
}
} else {
var msg = document.createElement("li");
msg.innerHTML = 'Erro interno, por favor, tente novamente mais tarde.';
$("#error-wrap ul").append(msg);
}
}
function onSubmit(token) {
var form = $("#signup-form");
var data = $(form).serializeFormJSON();
if (typeof(data.tags) === 'string') {
data.tags = [ data.tags ];
}
$.ajax({
type: "POST",
url: "https://cpm.teste.com/api/public/contact?g-recaptcha-response=" + token,
data: JSON.stringify(data),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
var redirectUrl = "/?go=cadastro-enviado-com-sucesso";
if (response.success) {
$("#error-wrap").hide();
$("#signup-form").addClass("success");
$("#signup-form #wrap").hide();
$("#success-wrap").show();
if (redirectUrl) {
window.location.href = redirectUrl;
}
} else {
onSubmitError(response);
}
},
error: function (error) {
onSubmitError();
}
});
}
</script>