Why the AWS SES service fails to send template emails

0

I am a backend developer using AWS services for my application, but when sending a regular email, it works flawlessly but while using sending templates, the SDK returns a positive response but the email is not being sent even after the emails have been verified. I use the Node JS AWS v3 SDK but until.

 const params = {
                Destination: {
                    ToAddresses: to
                },
                Source: from,
                Template: templateName,
                TemplateData: JSON.stringify(templateData)
            }
            await sesClient.send(new SendTemplatedEmailCommand(params))

code for operation and the templates have already been uploaded

<!DOCTYPE html>
<html>

<head>
    <title>Welcome to Our Community</title>
</head>

<body style="font-family: Arial, sans-serif; background-color: #f5f5f5; margin: 0; padding: 0;">
    <table align="center" border="0" cellpadding="0" cellspacing="0" width="600" style="border-collapse: collapse;">
        <tr>
            <td align="center" bgcolor="#ffffff" style="padding: 40px 0;">
                <img src={{company_logo}} alt="Company Logo" width="150">
            </td>
        </tr>
        <tr>
            <td bgcolor="#ffffff" style="padding: 40px 20px;">
                <h1>Welcome to Our Community!</h1>
                <p>Dear {{username}},</p>
                <p>We are excited to welcome you to our community! Thank you for joining us.</p>
                <p>Here's a brief overview of what you can expect:</p>
                <ul>
                    <li>Engage in meaningful discussions with like-minded individuals.</li>
                    <li>Access exclusive content and resources.</li>
                    <li>Stay updated with the latest news and events.</li>
                </ul>
                <p>We look forward to your active participation and contributions.</p>
                <p>If you have any questions or need assistance, feel free to contact us.</p>
                <p>Best regards,</p>
                <p>The {{company_name}} Team</p>
            </td>
        </tr>
        <tr>
            <td bgcolor="#ffffff" style="padding: 20px 20px;">
                <p style="font-size: 12px; color: #777;">You received this email because you signed up for an account at
                    {{company_name}}. If you believe this email was sent to you in error, please disregard it.</p>
            </td>
        </tr>
    </table>
</body>

</html>

template being targeted

{"company_logo":"https://www.edigitalagency.com.au/wp-content/uploads/twitter-logo-black-png.png","username":"Mboh Bless Pearl","company_name":"Twitter"}

data being passed

已提問 9 個月前檢視次數 269 次
1 個回答
0

Hi Mboh.

Please review the SES console and CloudTrail/CloudWatch logs to verify whether there was an issue after the email was accepted.

I hope this helps.

profile pictureAWS
專家
已回答 9 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南