Skip to content

Create Email Endpoint#346

Draft
justinschwerdtfeger wants to merge 11 commits intoUTDNebula:developfrom
justinschwerdtfeger:email
Draft

Create Email Endpoint#346
justinschwerdtfeger wants to merge 11 commits intoUTDNebula:developfrom
justinschwerdtfeger:email

Conversation

@justinschwerdtfeger
Copy link
Contributor

@justinschwerdtfeger justinschwerdtfeger commented Feb 27, 2026

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/queue and /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

  1. A user sends a POST request to /email/queue. They must have the x-email-queue-key header. It follows the EmailRequest schema I made, but I'm not too sure about the schema or the params/returns of the request right now.
  2. 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 the x-email-send-key header. 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-api
  3. sendEmail() uses env variables and request body to authenticate with Gmail SMTP (or another SMTP), and send the email

I'm not so sure about my naming, schema, parameters, and returns on my request, so I would really appreciate some advice.

@justinschwerdtfeger
Copy link
Contributor Author

justinschwerdtfeger commented Mar 2, 2026

This PR is mostly done, but I'm looking for advice on naming, schema, parameters/return for my endpoints

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants