Create Email Endpoint#346
Draft
justinschwerdtfeger wants to merge 11 commits intoUTDNebula:developfrom
Draft
Conversation
Contributor
Author
|
This PR is mostly done, but I'm looking for advice on naming, schema, parameters/return for my endpoints |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clubs (and potentially other projects) would benefit from being able to send email, and we can provide that through nebula-api.
This PR adds two POST endpoints (
/email/queueand/email/send) and some environment variables for basic email sending, It just uses SMTP. It's only intended for internal Nebula use.The queuing is handled through Google Cloud Task Queues.
The process is the following
/email/queue. They must have thex-email-queue-keyheader. It follows theEmailRequestschema I made, but I'm not too sure about the schema or the params/returns of the request right now.queueEmail()starts a Google Cloud Task with the target url being/email/send, and the request body being what the user sent. It also adds thex-email-send-keyheader. This Queuing process is done to rate limit emails to 500 a day or 2000 a day as that is Gmail's SMTP limit. The queue will also repeatedly retry until the email is successful, helping make sure emails are sent more reliably. The queue itself is separate from Nebula-apisendEmail()uses env variables and request body to authenticate with Gmail SMTP (or another SMTP), and send the emailI'm not so sure about my naming, schema, parameters, and returns on my request, so I would really appreciate some advice.