#!/usr/bin/env node /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 'use strict' var commandLineOptions = require('commander') var config = require('../config').getProperties() var fs = require('fs') var leftpad = require('leftpad') var log = require('../lib/log')(config.log.level, 'bulk-mailer') var Mailer = require('../mailer/index') var nodeMailerMock = require('./bulk-mailer/nodemailer-mock') var P = require('../lib/promise') var path = require('path') commandLineOptions .option('-b, --batchsize [size]', 'Number of emails to send in a batch. Defaults to 10', parseInt) .option('-d, --delay [seconds]', 'Delay in seconds between batches. Defaults to 5', parseInt) .option('-e, --errors [filename]', 'JSON output file that contains errored emails. Defaults to ./errors.json') .option('-i, --input ', 'JSON input file') .option('-t, --template