Resend Email Setup
Configure Resend for transactional emails in your ShadcnKit project
ShadcnKit uses Resend for sending transactional emails, including welcome emails to new users. This guide will walk you through setting up Resend for your project.
1. Create a Resend Account
- Go to Resend’s website and sign up for an account.
- After signing up, you’ll be directed to the Resend dashboard.
2. Add and Verify Your Domain
If you’re using Cloudflare for your domain, you can easily manage DNS records there for seamless integration with your ShadcnKit project.
-
In the Resend dashboard, go to the “Domains” section.
-
Click “Add Domain” and enter your domain name.
-
Resend will provide you with DNS records to add to your domain:
-
If using Cloudflare, add these records in your Cloudflare DNS settings.
-
Wait for Resend to verify your domain (this may take up to 24 hours).
3. Get Your API Key
- In the Resend dashboard, go to the “API Keys” section.
- Create a new API key or copy your existing one.
4. Add Resend API Key to Environment Variables
Add the following to your .env
file:
Replace your_resend_api_key
with the API key you copied from Resend.
5. Customize Welcome Email Template
ShadcnKit comes with a pre-configured welcome email template. You can customize it to fit your needs:
- Open
components/email/EmailTemplate.tsx
- Modify the content, styling, or structure as needed.
- You can also customize the email signature in
components/email/EmailSignature.tsx
How ShadcnKit Uses Resend
ShadcnKit automatically sends a welcome email to new users when they sign up through Logto. This is handled in the Logto webhook (app/api/logto-webhook/route.ts
).
Benefits of sending welcome emails:
- Immediately engage new users
- Provide important getting started information
- Establish a positive first impression
- Reduce the likelihood of users forgetting about your service
Resend allows you to track email opens and clicks, helping you understand user engagement with your welcome emails.
Facebook Conversion API Integration
ShadcnKit also sends a “CompleteRegistration” event to Facebook’s Conversion API when a new user signs up. This helps track the effectiveness of your Facebook ads. We’ll cover this in more detail in a separate guide.
Next Steps
With Resend set up, your ShadcnKit project is ready to send professional, customized transactional emails. Consider expanding your email strategy to include:
- Subscription confirmation emails
- Product update newsletters
Remember to always follow email best practices and comply with relevant regulations like GDPR and CAN-SPAM.