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

gefragt vor 9 Monaten269 Aufrufe
1 Antwort
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
EXPERTE
beantwortet vor 9 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen