jQuery( document ).on( 'click', '#guest_email', function(e) { e.preventDefault(); var ced_email_to = jQuery('#ced-email-to').val(); var postid = jQuery('#emailpostID').val(); $this = jQuery(this).parent().parent(); jQuery(this).parent().remove(); jQuery($this).append('processing'); jQuery.ajax({ url: postajaxsave.ajax_url, type: 'post', data: { action: 'postajax_exportandmail', ced_email_to: ced_email_to, postid: postid, }, success: function (response) { if(response.NOTSENT){ jQuery($this).find('img').remove(); jQuery($this).append('
processing

Sorry Your Email is not sent.

'); } else if(response.INVALIDEMAIL) { jQuery($this).find('img').remove(); var htmlq="
"; htmlq+= '

Please enter a valid e-mail address.

'; htmlq+=''; htmlq+="
"; jQuery($this).append(htmlq); } else if(response.SENT) { jQuery($this).html('sent

PDF is sent To Your Email Address

'); } } }); }); jQuery(function ($) { jQuery('.export-pdf').click(function(e) { e.preventDefault(); var postID = jQuery(this).attr('id'); var htmlq="
"; htmlq+=''; htmlq+=""; htmlq+="
"; jQuery('#examplePopup1').html(htmlq); jQuery('#emailpostID').val(postID); }); jQuery( document ).on( 'click', '#send_again', function(e) { $this = jQuery(this).parent().parent(); jQuery(this).parent().remove(); var htmlq="
"; htmlq+=''; htmlq+=""; htmlq+="
"; jQuery($this).append(htmlq); }); });