I am trying to attach pdf file to email and send email notifications to users. Problem is when try to use kendo.saveAs its opening in another window . If user browser is having pop up block, the email function is not working as it is not allowing open other window. Is there any way that i can do this in same window or any other option?
$.ajax({
type: "POST",
data: data,
url: "IUA/Submit",
success: function (result) {
if (result.Id !== 0) {
alert("Your application has completed the review phase and is confirmed complete. Your PIN will be " + result.Id + ". To complete your submission, please click the OK button below.");
$('#loading').hide();
kendo.drawing.drawDOM($("#mainDiv"))
.then(function (group) {
// Render the result as a PDF file
return kendo.drawing.exportPDF(group, {
paperSize: "auto",
margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" }
});
})
.done(function (data) {
// Save the PDF file
kendo.saveAs({
type: 'POST',
dataURI: data,
fileName: "IUAEnrollment.pdf",
proxyURL: '@Url.Action("SavePDF", "IUA")',
forceProxy: true,
proxyTarget: "_blank"
});
displayLoading("#formDiv", false);
location.reload();
});
} else if (result.IsDuplicateRec == true) {
$('#loading').hide();
$("#divDuplicate").show();
$("#captchaDiv").load(location.href + " #captchaDiv>*", "");
} else if (result.IsMVCCaptcha == false) {
$('label[for="lblCaptchaErr"]').show();
$("#captchaDiv").load(location.href + " #captchaDiv>*", "");
setTimeout(WaitUntilLoad, 6000);
}
},
error: function () {
$('#loading').hide();
alert("Error occured during the submission. Please contact helpdesk.");
}
});