🚸 (sendEmail) Better result logging
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
"google-auth-library": "8.5.2",
|
||||
"models": "workspace:*",
|
||||
"next-transpile-modules": "9.0.0",
|
||||
"node-fetch": "^3.2.10",
|
||||
"papaparse": "5.3.2",
|
||||
"typescript": "4.8.4",
|
||||
"uglify-js": "3.17.2",
|
||||
|
||||
@@ -112,7 +112,13 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
}
|
||||
try {
|
||||
const info = await transporter.sendMail(email)
|
||||
await saveSuccessLog(resultId, 'Email successfully sent')
|
||||
await saveSuccessLog(resultId, 'Email successfully sent', {
|
||||
transportConfig: {
|
||||
...transportConfig,
|
||||
auth: { user: transportConfig.auth.user, pass: '******' },
|
||||
},
|
||||
email,
|
||||
})
|
||||
return res.status(200).send({
|
||||
message: 'Email sent!',
|
||||
info,
|
||||
@@ -120,7 +126,10 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
})
|
||||
} catch (err) {
|
||||
await saveErrorLog(resultId, 'Email not sent', {
|
||||
transportConfig,
|
||||
transportConfig: {
|
||||
...transportConfig,
|
||||
auth: { user: transportConfig.auth.user, pass: '******' },
|
||||
},
|
||||
email,
|
||||
error: err,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user