An example of sending emails with Resend and indexing & searching those emails with Tigris Search.
The application is built with Next.js and Tailwind CSS.
npm iOr the equivalent with other package managers.
The following command uses the Tigris CLI to log you into Tigris Cloud (you can
signup if you don't already have an account), create a project, and save your
Tigris project configuration to a .env.local file.
npm run tigris:initBy default, the name awesome-email-search is used as the project name. You can override
this by passing in --project={name} flag. For example:
npm run tigris:init --project awesome-projectSignup for a Resend account and configure your domain so you can send emails from your domain via Resend.
Add a RESEND_API_KEY environmental variable with your Resend API key.
Add a DEFAULT_EMAIL with the email address associated with the domain you've configured with Resend.
Finally, setup Resend webhooks and configure them to point to {your-app}/api/email/webhook where {your-app} is a local proxy pointing to your app running on localhost:3000.
The repo contains a .env.example that you can use to check your .env.local or copy over and use directly.
Run the development server:
npm run dev
# or
yarn dev
# or
pnpm devOpen http://localhost:3000 with your browser to see the result.
Deploy the Awesome Email Search app to the Vercel Platform.