/time-sheet-mailer

A node-module to automatically send daily time-sheets

Primary LanguageJavaScriptMIT LicenseMIT

time-sheet-mailer

A node-module to automatically send excel time-sheets

Installation

npm install -g time-sheet-mailer

Configuration

tsm config

edit the existing demo-config according to your needs.
$project in email.subject will be replaced by the projectname.

This will try to open the tsm-config with your prefered editor, but falls back to vim if it can't find one. You can also specify the editor to use in an environment-variable, like so:

EDITOR=nano tsm config

google-caveats

If you use google, and don't have 2FA, you might need to allow less secure apps here
If you use google, and do have 2FA, you need to create an app-password here

Testing the config

tsm dryrun

This will not actually send emails, but show you what would be sent.

Sending the time-sheets

tsm run

Config-file

The config-file has the following format:

{
    "directory": "/path/to/your/timesheets",

    "smtp": {
        "host": "smtp.gmail.com",
        "port": 465,
        "username": "YourSMTPUsernameHere",
        "password": "YourSMTPPasswordHere"
    },

    "email": {
        "sender": "YourSender NameHere",
        "subject": "Timesheet for $project"
    },

    "mailadresses": {
        "boss": "boss@mycompany.com",
        "team": "team@mycompany.com",
        "accounting": "accounting@mycompany.com"
    },

    "projects": {
        "CoolProject": ["team"],
        "InternalProject": ["boss", "team"],
        "YourprojectNameHere": ["accounting", "boss"]
    }
}