how can I get a ‘then’, or asynchronously return an API response?
I use fastify, but it doesn’t wait for a response if you make a callback inside.
I tried that, but the error: TypeError: a.then is not a function
const a = await transporter.sendMail(mainOptions);
a.then((error, result) => {
if (error) return error
reply.send({
messageId: result.messageId
})
})