This project is a script for sending welcome emails to users based on a CSV file.
- Clone the repository.
- Install the dependencies by running
bun i
.
- Place your CSV file in the
files
directory. - Set the required environment variables by renaming the
.env.example
file to.env
and filling in the following values:HOST
: SMTP host for sending emails.PORT
: SMTP port.SECURE
: Set totrue
if the connection should be secure.AUTH_USER
: SMTP username.AUTH_PASS
: SMTP password.FROM_EMAIL
: Email address to use as the sender.
- Run the script by executing
bun index.ts
.
The welcome email template is defined in the mailOptions
object under html
in the code. You can customize the HTML content to fit your needs.
fs
: File system module for reading the CSV file.path
: Path module for resolving file paths.csv-parse
: CSV parsing library for parsing the CSV file.nodemailer
: Library for sending emails.