-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SES to send emails from web-backend #59
Conversation
c680b5e
to
454bee8
Compare
4d08486
to
0dfaff0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Muuten en keksinyt huomautettavaa, näyttää hyvältä
if (parseInt(process.env.SEND_EMAIL, 10)) { | ||
const info: Record<string, unknown> = await transporter.sendMail(mailOptions); | ||
winstonLogger.debug('System email notification delivery completed: ' + info); | ||
if (parseInt(process.env.SEND_SYSTEM_NOTIFICATION_EMAIL, 10)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lisäisin tähän eksplisiittisen tarkistuksen luettavuuden vuoksi, tyyliin:
if (parseInt(process.env.SEND_SYSTEM_NOTIFICATION_EMAIL, 10) === 1) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isEnabled funktio tehty joka tarkistaa onko env x arvo === '1'
if (!(process.env.SEND_EMAIL === '1')) { | ||
winstonLogger.debug('Email sending disabled'); | ||
const emails = materials.filter((m) => m.email != undefined).map((m) => m.email); | ||
if (!(process.env.SEND_EXPIRATION_NOTIFICATION_EMAIL === '1')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sama kommentti liittyen eksplisiittiseen tarkistukseen
@@ -84,8 +111,8 @@ export async function sendRatingNotificationMail() { | |||
holder[d.email] = d.materialname; | |||
} | |||
}); | |||
if (!(process.env.SEND_EMAIL === '1')) { | |||
winstonLogger.debug('Email sending disabled'); | |||
if (!(process.env.SEND_RATING_NOTIFICATION === '1')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eksplisiittinen vertailu myös tähän
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isEnabled funktio tehty joka tarkistaa onko env x arvo === '1'
winstonLogger.debug('Message sent: %s', info.messageId); | ||
const content = await verificationEmailText(url); | ||
|
||
if (process.env.SEND_VERIFICATION_EMAIL === '1') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tässä on sitten hieman eri tarkistus, joka on ok, mutta checkit voisi ehkä irrottaa apufunktioksi joka palauttaa boolean-arvon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isEnabled funktio tehty joka tarkistaa onko env x arvo === '1'
628019a
to
f65c012
Compare
99d1b41
to
d228ff6
Compare
This PR introduces AWS SES to dev and QA environments with domain identity.
aoe-web-backend mailService has been changed to use AWS SDK V2 SES to send emails instead of node mailer.
After deployment the SES is in sandbox mode which means that only to verified emails aoe can send an email. For production we need to request production access once the SES is deployed.