System Information
- Strapi Version: 3.6.8
- Operating System: Ubuntu
- Database: PostgreSQL
- Node Version: 14.x.x
hello guys, I’m trying to make sending email work through the method [strapi.plugins[“email-designer”].services.email.sendTemplatedEmail] in production (since localhost works)
I’ve already done all the SMTP-related settings, but it seems that the error is not even there, it seems that is in Strapi’s API, since the only error I get is 500. Please, if you need more information, just ask
{
"statusCode": 500,
"error": "Internal Server Error",
"message": "An internal server error occurred"
}
contacts/controller/contacts.js
module.exports = {
sendMail: async (ctx) => {
try {
const body = ctx.request.body;
await strapi.plugins["email-designer"].services.email.sendTemplatedEmail(
{
to: body.email,
from: 'no-reply@email.com.br'
},
{
templateId: 1,
},
{
body
}
);
return { status: "success" };
} catch (err) {
ctx.response.status = 404
return {
error: err.raw.message,
}
}
}
};