Skip to content

user invites: graphql: add email invite functionality

Warren Gifford requested to merge sg/email-invite into main

Created by: slimsag

This is a super simple backend that lets us send email invites to people from a registered user. For example:

image

This is used to power the collaborator invite frontend in #30595. You can set DEBUG_EMAIL_INVITES_MOCK=true and instead of sending real emails it will just log to the console:

email invites: mock invited to Sourcegraph invited_by="slimsag" invited="[email protected]"

There are no tests, because this is only 100 lines of code, and super easy to test manually + once the Cloud team builds out their Organizations/Teams invitation system this API will most likely be scrapped entirely!

I have gotten Security team's thumbs up. For abuse protection the same email address can only be invited once per 24h, AND the only customizable information in the email is the username of the person inviting you - so the risk of abuse is minimal.

DISABLE_EMAIL_INVITES=true may be set on the frontend containers (and then restarted) to entirely turn off this feature.

Helps #27101 (closed)

Signed-off-by: Stephen Gutekanst [email protected]

Merge request reports

Loading