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

Add Resend Email setup #24

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Add Resend Email setup #24

wants to merge 9 commits into from

Conversation

shrix1
Copy link
Contributor

@shrix1 shrix1 commented Jun 7, 2024

  • Added Resend and React-email (for email components form resend) package

  • Added EmailWrapperComponent and selectTemplate functions to select template based on request body

  • Added dummy WelcomeTemplate Component

  • Add keys to .env

       RESEND_API_KEY=
    
  • add and verfiy domain here

  • curl call to test locally ( to field can be arrayOfEmail or oneEmail )

           curl --location 'http://localhost:3000/api/mail' \
                  --header 'Content-Type: application/json' \
                  --data-raw '{
                        "to": "[email protected]",
                         "subject": "Subject here",
                         "data": {
                              "template": "WELCOME",
                               "userName": "Shri"
                           }
                  }'       
    
Screenshot 2024-06-08 at 1 33 52 AM

Supabase SMTP setup here - https://resend.com/settings/integrations for signup/otp mails

Screenshot 2024-06-08 at 1 51 32 AM

Based on : #21

Copy link

vercel bot commented Jun 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
pear-landing-page ❌ Failed (Inspect) Aug 2, 2024 8:59pm
pear-landing-page-main ❌ Failed (Inspect) Aug 2, 2024 8:59pm
pear-landing-page-uwmp ❌ Failed (Inspect) Aug 2, 2024 8:59pm

@shrix1
Copy link
Contributor Author

shrix1 commented Jun 7, 2024

🔴 Build failed because there is no RESEND_API_KEY

@Fryingpannn
Copy link
Contributor

Fryingpannn commented Jun 13, 2024

@shrix1 Yo ty for this! Let's resolve the conflicts! I will add resend api into server env variables

*Edit: env var added!

@Fryingpannn Fryingpannn linked an issue Jun 18, 2024 that may be closed by this pull request
Copy link

vercel bot commented Jun 18, 2024

@shrix1 is attempting to deploy a commit to the PearAI Team on Vercel.

A member of the Team first needs to authorize it.

@shrix1
Copy link
Contributor Author

shrix1 commented Jun 18, 2024

Add Resend in example.env file

@Ellahinator
Copy link
Contributor

Ellahinator commented Jun 26, 2024

We can simply set this up with Resend and Supabase only, without any changes to the code following this guide: https://resend.com/blog/how-to-configure-supabase-to-send-emails-from-your-domain

Supabase allows us to change email templates in supabase itself.

@shrix1
Copy link
Contributor Author

shrix1 commented Jun 26, 2024

Supabase only allow signup, login, magiclink templates right, with this integration we can add marketing emails aswell eg: we can send welcome email with pricing on it

@Ellahinator
Copy link
Contributor

Supabase only allow signup, login, magiclink templates right, with this integration we can add marketing emails aswell eg: we can send welcome email with pricing on it

Ah I see. Makes sense.

@shrix1
Copy link
Contributor Author

shrix1 commented Jun 26, 2024

Supabase only allow signup, login, magiclink templates right, with this integration we can add marketing emails aswell eg: we can send welcome email with pricing on it

Ah I see. Makes sense.

For signup and login email with supabase intergration is super simple in a one click of a button
https://resend.com/settings/integrations

Screenshot 2024-06-27 at 12 15 23 AM

@Fryingpannn
Copy link
Contributor

This will be essential needed for

  • Welcoming message after using confirms email
  • Maybe subscription emails (not sure if stripe manages that)

@Fryingpannn
Copy link
Contributor

Fryingpannn commented Aug 2, 2024

Looks like got some prettier errors. Run yarn prettier --write .

This is still great and needed! Will increase priority on this as we reach public launch

@Fryingpannn Fryingpannn self-requested a review August 2, 2024 18:27
@shrix1
Copy link
Contributor Author

shrix1 commented Aug 2, 2024

Looks like got some prettier errors. Run yarn prettier --write .

This is still great and needed! Will increase priority on this as we reach public launch

Got it

@cqdev-co
Copy link
Contributor

cqdev-co commented Sep 3, 2024

@Fryingpannn should probably try to get this integrated sooner than later

@Fryingpannn
Copy link
Contributor

Fryingpannn commented Sep 15, 2024

@shrix1 Great work on this one, we kinda need it now. But it seems it's better if this is built from our Python backend server instead of the landing page 💀. There could be times where backend finishes something (e.g. stripe cancellation), then needs to send email. In which case if it's only here, the backend would have to send a request to the nextjs backend. That is not ideal. Do you think you can help with this? 🙏

Alternatively, we can just have resend in both lmao, since it's already made here. If we fix the current conflicts, I can try to get this in first. Then gradually we switch to python backend once it's needed.

@shrix1
Copy link
Contributor Author

shrix1 commented Sep 16, 2024

@shrix1 Great work on this one, we kinda need it now. But it seems it's better if this is built from our Python backend server instead of the landing page 💀. There could be times where backend finishes something (e.g. stripe cancellation), then needs to send email. In which case if it's only here, the backend would have to send a request to the nextjs backend. That is not ideal. Do you think you can help with this? 🙏

Alternatively, we can just have resend in both lmao, since it's already made here. If we fix the current conflicts, I can try to get this in first. Then gradually we switch to python backend once it's needed.

@Fryingpannn I don't know much about Django, but I'll look into it 🫡. There's also a Resend Python SDK, so I'll try using that as well.

@Fryingpannn
Copy link
Contributor

@shrix1 Great work on this one, we kinda need it now. But it seems it's better if this is built from our Python backend server instead of the landing page 💀. There could be times where backend finishes something (e.g. stripe cancellation), then needs to send email. In which case if it's only here, the backend would have to send a request to the nextjs backend. That is not ideal. Do you think you can help with this? 🙏
Alternatively, we can just have resend in both lmao, since it's already made here. If we fix the current conflicts, I can try to get this in first. Then gradually we switch to python backend once it's needed.

@Fryingpannn I don't know much about Django, but I'll look into it 🫡. There's also a Resend Python SDK, so I'll try using that as well.

Awesome. Check in with @Ellahinator on discord, I think he started it!

@shrix1
Copy link
Contributor Author

shrix1 commented Sep 17, 2024

@shrix1 Great work on this one, we kinda need it now. But it seems it's better if this is built from our Python backend server instead of the landing page 💀. There could be times where backend finishes something (e.g. stripe cancellation), then needs to send email. In which case if it's only here, the backend would have to send a request to the nextjs backend. That is not ideal. Do you think you can help with this? 🙏
Alternatively, we can just have resend in both lmao, since it's already made here. If we fix the current conflicts, I can try to get this in first. Then gradually we switch to python backend once it's needed.

@Fryingpannn I don't know much about Django, but I'll look into it 🫡. There's also a Resend Python SDK, so I'll try using that as well.

Awesome. Check in with @Ellahinator on discord, I think he started it!

yaa i saw discord, he is testing with resend , cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add RESEND SMTP
5 participants