A program that generates ZIX-encrypted invoice drafts, given a master client list and matching attachments.
- Clone this repository on your local machine.
- Download Node.js (for either Windows or Mac).
The invoice generator uses the Gmail API, so you'll have to authorize the application to access your personal inbox.
- Generate credentials by navigating to https://developers.google.com/gmail/api/quickstart/go.
- Click 'Enable the Gmail API'.
- Download the client configuration and open the file.
- Copy the contents of the file to the credentials.json file within this application.
The application hinges upon the existence of a master_incentives_savings_template.xlsx file existing on the top level of the program. The contents of this file should match the schema defined at the top of the contacts.js file.
All potential attachments must be stored within the 'invoices' folder, and should include their matching Employer Group ID from master_incentives_savings_template.xlsx somewhere within the file name.
Body: The email body is sourced from the email_body.txt file. If you wish to change the text of the email body, this is where you should update it.
Subject & From: These fields can be updated in the constructor of the mail.js file.
The default task of the program is 'draft', i.e., the script will generate email drafts to your Gmail Drafts which you can manually send at your leisure. Alternatively, you can change the task to 'mail' in the mail.js file, which will automatically send your generated emails to all recipients. The sent emails will show up in your Sent inbox.
The first time the program is run, the application will need to generate an authorization token prior to completing the script. Any subsequent runs of the program will not require generating a new token.
- Make sure all setup has been completed prior to running the program (see above).
- Run
node index.js
from your console. - Follow the instructions and go to the URL given.
- Authorize Quickstart and copy the resulting code in your console.
- The program should output successes or errors accordingly.