Skip to content

Conversation

@dburkhart07
Copy link

ℹ️ Issue

Closes #109

📝 Description

This ticket creates an initial part of our email automation. This was actually very straightforward, and followed a similar architecture that JPAL uses. To get this working, I needed to verify my email on AWS SES, which can be done through the following:

  1. Go into AWS SES
  2. Click on Identities in the sidebar
  3. Click create identity
  4. Add the email that you want to send with
  5. Create this new identity
  6. This is now the email that we can set as our new environment variable, AWS_SES_SENDER_EMAIL (all sender emails must be verified). THIS WILL BE UPDATED IN THE README AFTER WE MERGE IN THE ENVIRONMENT VARIABLE PR.

Additionally, here is some logic of what each of the file's purposes serve:
awsSesClient.factory.ts serves as the main configuration for the SES Client. It provides the user's access key and id to allow them to use the service API. It also provides a client to be injected later on.
awsSes.wrapper.ts injects this factory into the constructor, making it a valid client that has all SES functionality. This allows us to easily setup the proper parameters to send an email with varying complexity (supporting image attachments as well).
email.service.ts provides the service function that we will actually be calling with our API. All controllers will likely need to use this in their module which we have setup. This allows them to send a simple DTO and send an email just like that.

✔️ Verification

I made sure that we could send emails as is, as well as one with email attachments. I created a dummy endpoint for right now in the pantries.controller.ts file.

image image

🏕️ (Optional) Future Work / Notes

The emails are currently being marked as spam for some reason, not qutie sure as to why yet. Perhaps there is an AWS setting to change that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants