docs: function sendMail(opt, callback){
  	var fileName = path.normalize(path.join(__dirname, opt.template));
  	fs.readFile(fileName, 'utf8', function (err,data) {
  		if (err) {
  			return callback(err);
  		}
  		const authUrl = opt.req.protocol + '://' + opt.req.get('host') + opt.auth + opt.user.authToken;
  		let emailText  = data.replace(/<EMAIL>/g, opt.user.email || "");
  		emailText  = emailText.replace(/<USER>/g, opt.user.username || "");
  		emailText  = emailText.replace(/<URL>/g, authUrl);
  		emailText  = emailText.replace(/<PASSWORD>/g, opt.pwd || "");
  		const subjLineIndex = emailText.indexOf("\n"),
  			subject = emailText.substr(0, subjLineIndex),
  			body = emailText.substr(subjLineIndex),
  			smtpConfig = {
  				host: opt.options.configParams.get("mail.smtp.host"),
  				port: opt.options.configParams.get("mail.smtp.port"),
  				secure: true,
  				auth: {
  					user: opt.options.configParams.get("mail.smtp.user"),
  					pass: opt.options.configParams.get("mail.smtp.password")
  				}
  			};
  		if (opt.options.configParams.get("mail.from")) {
  			const transport = nodemailer.createTransport(smtpConfig);
  			const mailOptions = {
  				from: opt.options.configParams.get("mail.from"),
  				to: opt.user.email,
  				subject: subject,
  				text: body, 
  			};
  			transport.sendMail(mailOptions, function(error, info) {
  				if (error) {
  					logger.error(error + " " + info);
  					callback(error);
  				}
  				callback(null, info);
  			});
  		} else {
  			// used for local dev testing (no email is sent, logged to console)
  			logger.info(body);
  			callback(null);
  		}
  	});
  }