Repository navigation
feat(email): add configurable email provider abstraction and summary email support - #264
Conversation
favicon and social card fixes --------- Signed-off-by: Cameron Target <camerontarget@gmail.com> Signed-off-by: KrishnaAdityaSrivastava <krishnaadityasrivastava@gmail.com>
Signed-off-by: KrishnaAdityaSrivastava <krishnaadityasrivastava@gmail.com>
Signed-off-by: KrishnaAdityaSrivastava <krishnaadityasrivastava@gmail.com>
Signed-off-by: KrishnaAdityaSrivastava <krishnaadityasrivastava@gmail.com>
843e870 to
efdf0d9
Compare
|
Hi @KrishnaAdityaSrivastava thanks for taking this on. I do have a few concerns. The first is that you implemented for multiple services. Have you accually sent an email from each of these services? As a new contributor, we do want to ensure that PRs being pushed have been throughly tested. The other concern that is the emails themselves are not designed. That being said, we can address this in the follow up PR as we gather more user stories. For now, can you confirm that you have successfully send emails using these providers? We do not need multiple services to start. Just an SMTP example of sending the email is good to start. |
|
Thanks for the review! Yes, I’ve tested SMTP and Resend end-to-end locally, and both sent the summary email successfully. For SendGrid, I’m getting a 401 from their API, so I haven’t been able to confirm it works end-to-end. I believe that’s an issue with my account/API key (my trial may have expired). I’m happy to remove it from this PR if you’d prefer to keep the scope to the providers that are verified, or keep it if you’d like to look at it. Let me know which you’d prefer. I’m also about to push a refactor that cleans up the provider code. On the email design, agreed. The templates are intentionally minimal for now, and I’ll iterate on them in a follow-up PR as user stories come in. |
Signed-off-by: KrishnaAdityaSrivastava <krishnaadityasrivastava@gmail.com>
cb12276 to
331f523
Compare
|
Few things missing:
Here were the setup instructions from cursor for smtp & gmail. Just needs to be addapted to the docs: |
Signed-off-by: James Spadafora <spadjv@gmail.com>
|
Hey @KrishnaAdityaSrivastava let me know if you need anything to wrap this up |
Bring the branch current with main, and finish the email-provider review: document noop, SMTP (including Gmail), Resend, and SendGrid, prompt for them in bootstrap, and cover each provider with unit tests. Signed-off-by: James Spadafora <spadjv@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Updated the branch onto main and finished the remaining review notes.
|
|
Thanks for your contribution! |
Summary
This PR introduces a configurable email provider abstraction following the existing provider pattern used throughout the backend.
Changes
EmailProviderBaseabstraction with provider selection via configuration.get_email_provider) to instantiate the configured email provider.EmailBuilderto generate email subject, plain text, and HTML content.POST /playlists/{playlist_id}/send-summary-emailendpoint for sending playlist summary emails.Testing
How I Tested
Ran the email provider test suite locally:
docker compose exec api pytest tests/email_providers/test_email_provider_base.py -vVerified:
fixes #255