Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up basic SendGrid Handler #73

Merged
merged 15 commits into from
Dec 15, 2023
Merged

Set up basic SendGrid Handler #73

merged 15 commits into from
Dec 15, 2023

Conversation

samderanova
Copy link
Contributor

@samderanova samderanova commented Dec 12, 2023

This pull request includes a function that sends emails using SendGrid.

Required environment variables:

  • SENDGRID_API_KEY: needed to use the SendGrid API. This has already been added to Vercel.

@samderanova samderanova linked an issue Dec 12, 2023 that may be closed by this pull request
apps/api/src/services/sendgrid_handler.py Outdated Show resolved Hide resolved
apps/api/src/services/sendgrid_handler.py Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Dec 12, 2023

Deploy preview for irvinehacks-site-2024-sanity ready!

Name Sanity Studio
Preview Visit Preview
Commit 31d47b9

Copy link
Contributor

github-actions bot commented Dec 12, 2023

Deploy preview for irvinehacks-site-2024 ready!

Name IrvineHacks 2024 Site
Preview Visit Preview
Commit 31d47b9

tyleryy
tyleryy previously approved these changes Dec 12, 2023
apps/api/src/services/sendgrid_handler.py Outdated Show resolved Hide resolved
Copy link
Member

@taesungh taesungh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also import the unit tests from test_sendgrid_handler.py?
We'll also need the email_handler.py at some point, not sure if you want to do that now or separately.

@samderanova
Copy link
Contributor Author

Could we also import the unit tests from test_sendgrid_handler.py? We'll also need the email_handler.py at some point, not sure if you want to do that now or separately.

Currently working on both 👍

apps/api/tests/test_sendgrid_handler.py Outdated Show resolved Hide resolved
apps/api/tests/test_sendgrid_handler.py Outdated Show resolved Hide resolved
apps/api/tests/test_sendgrid_handler.py Outdated Show resolved Hide resolved
apps/api/src/utils/PersonalizationData.py Outdated Show resolved Hide resolved
apps/api/src/utils/PersonalizationData.py Outdated Show resolved Hide resolved
apps/api/src/utils/PersonalizationData.py Outdated Show resolved Hide resolved
apps/api/src/utils/PersonalizationData.py Outdated Show resolved Hide resolved
taesungh and others added 4 commits December 14, 2023 15:39
- Move `Template` enum from email_handler to sendgrid_handler
- Include overloads to associate each SendGrid template with specific
  personalization data
- Use overloads for `send_to_multiple` parameter which affects shape of
  provided `receiver_data`
taesungh
taesungh previously approved these changes Dec 15, 2023
Copy link
Member

@taesungh taesungh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for including stubs on this. Let's squash during merge.

njhuey
njhuey previously approved these changes Dec 15, 2023
Copy link
Contributor

@njhuey njhuey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgmt

apps/api/src/services/sendgrid_handler.py Outdated Show resolved Hide resolved
@samderanova
Copy link
Contributor Author

samderanova commented Dec 15, 2023

Please do not merge this PR yet, as I am testing template sending using the Hack group account. Previously SendGrid is tied to a separate Hack account, but for some reason, sending emails from this account is not working correctly.

I will update the template IDs when I get it working.

Copy link
Contributor

@njhuey njhuey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgmt

Copy link
Member

@taesungh taesungh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rip account but I guess it's only reasonable when we're out of time.

@samderanova samderanova merged commit c48c987 into main Dec 15, 2023
4 checks passed
@taesungh taesungh deleted the setup/sendgrid branch December 17, 2023 07:21
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.

Set up Sendgrid emailing service
4 participants