git clone https://github.com/DSC-UNSRI/mail-app
cd mail-app
pnpm install
or if you using npm
npm install
After installation, run this to generate .env
cp .env.example .env
-
CSV_PATH : this variable used to define the path to csv file relative to current project / workspace
-
HTML_FILE_TO_SEND_PATH : this variable used to define the path to html file template that will be used as body of the email
-
SUBJECT_EMAIL : this variable used to define the subject of the email
-
TEMPLATE_DATA : this variable should be in array of array format, used to define the data that will be sent as context in handlebars template (See handlebars docs for complete explanation). The format should be in [key, index]. The index is based on the csv file that you defined in CSV_PATH variable, and the key is based on the template that you define in HTML_FILE_TO_SEND_PATH. Index should be number, and key should be string.
-
RECEIVER_EMAIL_IDX : this variable used to define index of email in the csv file. Value should be number
-
EMAIL : this is email address that you used to send emails
-
GOOGLE_CLIENT_ID : this is google client id obtained from credentials section in google cloud console
-
GOOGLE_CLIENT_SECRET : this is google client secret obtained from credentials section in google cloud console
-
REFRESH_TOKEN : this is refresh token obtained from google oauth playground
- Make Email template from Google Docs and Download as .html
- Change src attribute from image file path, to uploaded image link
- Change to iniline-css using mailchimp: https://templates.mailchimp.com/resources/inline-css/