Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yasaryousuf/42d6115aed3639b78a1f8fb8b957d6c5 to your computer and use it in GitHub Desktop.
Save yasaryousuf/42d6115aed3639b78a1f8fb8b957d6c5 to your computer and use it in GitHub Desktop.
$('.mail-box-2').click(function(event){
$('.modal_historique_id').val($(this).data("historique_id"));
});
$('#historique_send').click( function(event){
$.LoadingOverlay("show");
var email = $('.historique-custom-input').val();
// var historique_id = $("#envelope").data("historique_id")
var historique_id = $('.modal_historique_id').val();
event.preventDefault();
$.ajax({
url: WCP_Ajax.ajaxurl,
type: 'POST',
data: {
action: 'send_history_email',
email: email,
historique_id: historique_id,
},
})
.done(function(response) {
$.LoadingOverlay("hide");
$('#mailModal').modal('toggle');
if (response.success == false) {
swal("Sorry!", response.data.message , "error");
}
else {
swal("Great!", response.data.message, "success");
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment