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 dependenciesCreate 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-vaultSee 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 databaseModify the dump.sql file to change the database schema and/or populate the tables.
pnpm run dev # Start the serverpnpm run build # Build the projectOutput will be in the ./dist directory.
pnpm run test # Run the testspnpm run coverage # Run the tests with coveragepnpm run deploy # Deploy to Netlifyor push to your repository and Netlify will automatically deploy the changes.