🔥 The free & Open Source DocuSign alternative
JavaScript digital-signaturedocument-signingdocusign-alternativedocusign-freee-signatureelectronic-signatureelectronic-signaturesesignesignaturehacktoberfestjavascriptlegaltechmongodbnodejsopen-sourcepdf-signpdf-signaturereactjsself-hostedsign-pdf-files
fix: sendmail functionality not working
prafull-opensignlabs359d86e17b8f
diff --git a/apps/OpenSign/.gitignore b/apps/OpenSign/.gitignoreindex cc964cb27..b96e769c8 100644--- a/apps/OpenSign/.gitignore+++ b/apps/OpenSign/.gitignore@@ -10,6 +10,7 @@# production/build+/mfbuild# misc.envdiff --git a/apps/OpenSignServer/cloud/parsefunction/sendMail.js b/apps/OpenSignServer/cloud/parsefunction/sendMail.jsindex fb964e28f..c607c2822 100644--- a/apps/OpenSignServer/cloud/parsefunction/sendMail.js+++ b/apps/OpenSignServer/cloud/parsefunction/sendMail.js@@ -55,29 +55,27 @@ async function sendmail(req) {const file = {filename: pdfName || 'exported.pdf',content: process.env.SMTP_ENABLE ? PdfBuffer : undefined, //fs.readFileSync('./exports/exported_file_1223.pdf'),- data: process.env.SMTP_ENABLE ? undefined : PdfBuffer,+ data: process.env.SMTP_ENABLE ? undefined : PdfBuffer,};// const html = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /></head><body style='text-align: center;'> <p style='font-weight: bolder; font-size: large;'>Hello!</p> <p>This is a html checking mail</p><p><button style='background-color: lightskyblue; cursor: pointer; border-radius: 5px; padding: 10px; border-style: solid; border-width: 2px; text-decoration: none; font-weight: bolder; color:blue'>Verify email</button></p></body></html>"const from = req.params.from || '';+ const mailsender = process.env.SMTP_ENABLE+ ? process.env.SMTP_USER_EMAIL+ : process.env.MAILGUN_SENDER;const messageParams = {- from:- from + ' <' + process.env.SMTP_ENABLE- ? process.env.SMTP_USER_EMAIL- : process.env.MAILGUN_SENDER + '>',+ from: from + ' <' + mailsender + '>',to: req.params.recipient,subject: req.params.subject,text: req.params.text || 'mail',html: req.params.html || '',- attachments: process.env.SMTP_ENABLE ? [file] : undefined,- attachment: process.env.SMTP_ENABLE ? undefined : file,+ attachments: process.env.SMTP_ENABLE ? [file] : undefined,+ attachment: process.env.SMTP_ENABLE ? undefined : file,};-if (transporterSMTP) {const res = await transporterSMTP.sendMail(messageParams);-console.log('Res ', res);if (!res.err) {return {@@ -96,11 +94,12 @@ async function sendmail(req) {}} else {const from = req.params.from || '';+ const mailsender = process.env.SMTP_ENABLE+ ? process.env.SMTP_USER_EMAIL+ : process.env.MAILGUN_SENDER;+const messageParams = {- from:- from + ' <' + process.env.SMTP_ENABLE- ? process.env.SMTP_USER_EMAIL- : process.env.MAILGUN_SENDER + '>',+ from: from + ' <' + mailsender + '>',to: req.params.recipient,subject: req.params.subject,text: req.params.text || 'mail',@@ -109,7 +108,6 @@ async function sendmail(req) {if (transporterSMTP) {const res = await transporterSMTP.sendMail(messageParams);-console.log('Res ', res);if (!res.err) {return {