How to compose email with AWS SES sent from Node server and NOT end up in the Promotions Tab of Gmail?

270 views Asked by At

My app sends out email with AWS SES from my node server and all my emails keep ending up in the Promotions Tab of Gmail.

How can I make my emails end up in the Primary Tab in Gmail?

Basically, my email is a simple "confirm your email account" email that is sent to the user after he/she submits registration information on my website. The user will have to click on the link in this email to confirm his email and his account on my website will be created. See below for how I crafted my email on Node.

What I have tried but still I end up in Promotions Tab:

  1. I realize if I put phrases like "click on the link", I end up in Promotions. But even if I replaced that phrase with "open the one-time-use link" like below, I still end up in Promotions.
  2. I avoided fancy html
  3. No pictures
  4. I even replaced [email protected] to [email protected] (e.g. [email protected]) it still ends up in Promotions!

I read somewhere to avoid HTML entirely to trick Gmail filters to thinking its written by a human. But how can I do that with aws.ses? Is this the cure?

I am pretty sure many have faced this is an issue. My users keep telling me that they did not receive the confirmation email when in fact it landed in their Promotions Tab. Please help! Any ideas will be much appreciated. Thank you.

// CREATE THE HTML
const html = `
      <!doctype html>
      <html>
        <head>
          <meta charset="utf-8">
        </head>
        <body>
          <div >
            <p>Hello John!</p>
            <p>Please open the one-time-use link below to confirm your email.</p>

            <div >
              <a href=https://mywebsite.com>Confirm Email</a>
            </div>

            <p>Not expecting this email? Please disregard this message.</p>

            <p>Thank you</p>

          </div>
        </body>
      </html>
`


// CREATE PARAMS FOR SES
const params = {
      Destination: {
        BccAddresses: [], 
        CcAddresses: [], 
        ToAddresses: ["[email protected]"],
      },
      Message: {
        Body: {
          Html: {
            Charset: "UTF-8", 
            Data: html
          }, 
          Text: {
            Charset: "UTF-8", 
            Data: text
          }
        }, 
        Subject: {
          Charset: "UTF-8", 
          Data: `mywebsite: Confirm New Account k`, // Subject line
        }
      }, 
      ReplyToAddresses: [], 
      Source: `"mywebsite" <[email protected]>`, // sender address
  }


  //SEND OUT EMAIL
  ses.sendEmail(params, function(err, data) {
      if (err) {
        console.log(err, err.stack); // an error occurred
        returnFunc(err); // return END of func fail
      } else {
        console.log(data);           // successful response
        returnFunc(null, data); // return END of func success
      }
      */
  });
  
  

0

There are 0 answers