Created
April 28, 2018 04:42
-
-
Save yasaryousuf/42d6115aed3639b78a1f8fb8b957d6c5 to your computer and use it in GitHub Desktop.
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
$('.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