AWS Lamba with Cognito - Unable to use style tag on custom email message

24 Views Asked by At

I'm trying to customize a verification email for Cognito through a Lambda function.

This is my template:

     <style>
          .title {
            color: red;
           }

     </style>
     <h1 class="title">Your verification code</h1>
     <h3>Enter your verification code in the Admin UI</h3>
     <h3 style="font-weight: 700; color: #305cf3">${code}</h3>
     <span>You can also verify your account by clicking
     <a style="text-decoration: none"
        href="http://localhost:5173/register/confirm?user=${event.request.userAttributes.email}?code=${code}">here
     </a>
     </span>

But the email that I receive is not having the declared styles for my H1 with class 'title'. Also it doesn't recognizes any style declared inside the style tag. All my elements declared with inline-styles are being rendered correctly. I also tried to surround all my elements inside a body and a html tag but it's not working neither.

Anything that i'm missing?

0

There are 0 best solutions below