This application allows users to import a CSV file containing contact information, preview the data, and send personalized emails to the contacts.
- CSV file import
- Data preview with pagination
- Email template preview
- Bulk email sending
Before you begin, ensure you have met the following requirements:
- Node.js (v14 or later) installed on your machine
- npm (Node Package Manager) installed
-
Clone the repository:
git clone https://github.com/yourusername/csv-email-sender.git cd csv-email-sender -
Install the dependencies:
npm install
-
Create a
.envfile in the root directory of the project. -
Add the following environment variables to the
.envfile:SMTP_HOST=your_smtp_host SMTP_PORT=your_smtp_port SMTP_SECURE=true_or_false SMTP_USER=your_smtp_username SMTP_PASS=your_smtp_passwordReplace the values with your actual SMTP server details.
-
Start the application:
npm startOr, if you want to run it in development mode with auto-restart:
npm run dev -
Open your web browser and navigate to
http://localhost:3000. -
Use the application:
- Click "Choose File" to select your CSV file, then click "Import CSV" to upload it.
- The imported data will be displayed in a paginated table.
- Click "Preview Email" to see how the email will look for the first contact in your CSV.
- Click "Send Emails" to send emails to all contacts in the CSV file.
Your CSV file should have the following columns:
- Full Name
- Email Address
- Door Code
Example:
Full Name,Email Address,Door Code John Doe,john.doe@example.com,1234 Jane Smith,jane.smith@example.com,5678
Make sure your CSV file is properly formatted and does not contain any extra columns or rows.
- To modify the email template, edit the
views/emailTemplate2.ejsfile. - To change the page layout or styling, edit the
views/csvImport.ejsandviews/emailPreview.ejsfiles.
- If emails are not being sent, check your SMTP configuration in the
.envfile. - Ensure your CSV file matches the expected format.
- Check the console for any error messages.
Contributions to the CSV Email Sender are welcome. Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b <branch_name>. - Make your changes and commit them:
git commit -m '<commit_message>' - Push to the original branch:
git push origin <project_name>/<location> - Create the pull request.
Alternatively, see the GitHub documentation on creating a pull request.
This project uses the following license: MIT License.