A simple email sender using nodemailer and Turso database.
- Nodemailer is used to send emails.
- Turso database is used to store email templates.
- Netlify to host the serverless functions and is AWS Lambda compatible.
pnpm install # Install the dependencies
Create a .env
file in the root directory and add the following environment variables or use npx/pndm dlx to create the .env
file.
See https://www.dotenv.org/docs/quickstart for CLI commands
Example:
pnpm dlx dotenv-vault@latest push # push to dotenv-vault
pnpm dlx dotenv-vault@latest pull # pull from dotenv-vault
See list of pnpm run env:
commands in the package.json
file.
Turso is a simple database that uses SQLite3. It has a generous free tier. See https://turso.tech/ for more information.
You can use the Turso database to store email templates.
Open the ./scripts/db.ts
file to create the database and tables.
pnpm run db:create # Create the database
Modify the dump.sql
file to change the database schema and/or populate the tables.
pnpm run dev # Start the server
pnpm run build # Build the project
Output will be in the ./dist
directory.
pnpm run test # Run the tests
pnpm run coverage # Run the tests with coverage
pnpm run deploy # Deploy to Netlify
or push to your repository and Netlify will automatically deploy the changes.