GoodDollar / GoodServer

Backend to support the GoodDAPP
MIT License
13 stars 14 forks source link

Send email verification from backend using SES #279

Closed sirpy closed 3 years ago

sirpy commented 4 years ago

SES credentials - already set on goodserver-qa/next heroku as AWS_KEY and AWS_SECRET region: eu-west-1 template: 'VerificationEmail' data fields for template are firstname and code

see how to send from SES https://medium.com/better-programming/how-to-send-emails-with-node-js-using-amazon-ses-8ae38f6312e4

let sendTemplateEmail = (recipientEmail) => {
    let params = {
      Source: '<email address you verified>',
      Template: '<name of your template>',
      Destination: {
        ToAddresse': [ 
          recipientEmail
        ]
      },
      TemplateData: '{ \"name\':\'John Doe\'}'
    };
    return AWS_SES.sendTemplatedEmail(params).promise();
};
iLystopad commented 3 years ago

@sirpy The user receives the verification code by email without issues after editing the email on the Edit profile screen or after the verification email while sign up with Auth0

Checked on the QA 1.24.1-6 Device: Desktop / Windows 10 / Google Chrome 89.0.4389.90