Issue with sendTemplatedEmail
See original GitHub issueTried triggering email using sendTemplatedEmail with the following codes but encountered Bad Request 400 error, and the weird part is there was no error message returned. Using v0.4.1.
try {
await strapi.plugins['email-designer'].services.email.sendTemplatedEmail(
{
to: user.email, // required
from: 'no-reply@xxx.com', // optional if /config/plugins.js -> email.settings.defaultFrom is set
replyTo: 'no-reply@xxx.com', // optional if /config/plugins.js -> email.settings.defaultReplyTo is set
},
{
templateId: 4, // required - you can get the template id from the admin panel
subject: 'Welcome'
},
{
// this object must include all variables you're using in your email template
project_name: 'Test Mailer',
}
);
} catch (err) {
strapi.log.debug('📺: ', err);
return ctx.badRequest(null, err);
}
This is the debug error from Strapi, which is an empty error.
[2021-05-14T07:51:27.462Z] debug �📺:
[2021-05-14T07:51:27.464Z] debug POST /auth/local/register (11297 ms) 400
The response from API call is empty as well.
{
"statusCode": 400,
"error": "Bad Request",
"message": {},
"data": {}
}
Sending email using the old API works but flagged as depreciated.
await strapi.plugins['email-designer'].services.email.send({
templateId,
to,
from,
replyTo,
// subject,
data: userData,
});
Couldn’t verify whether it’s related to the template_id faced by Sendgrid.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Troubleshoot Amazon SES SendTemplatedEmail delivery ...
I'm using the SendTemplatedEmail operation to send messages from my Amazon Simple Email Service (Amazon SES) account.
Read more >SES.sendTemplatedEmail silently fails when one of ... - GitHub
Hi, I have created a template in SES with four {{variables}} to be interpolated. When I call the SES.sendTemplatedEmail and one of the ......
Read more >Amazon SES does nothing - Stack Overflow
I'm trying to use the Amazon SES sendTemplatedEmail function. ... Issue sending email from localhost using amazon web services SES.
Read more >Configuring Send Templated Email Order Module
Configuring Send Templated Email Order Module. When the module runs, a templated email is sent to the client or to a predetermined appropriate...
Read more >Solved: Re: ACS-Commons "Send Templated Email" process ...
Hi All,. Hope you all are doing well. I'm trying to use ACS-Commons "Send Templated Email" process in my workflow step to send...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you very much! I will look into it!
You can use this code everywhere in your custom code. For example:
strapi/api/**/controllers/**.js
.