Description:
To setup LCOS based e-mail alerts you need to configure an SMTP mail server, as well as actions that trigger the respective behavior.
You will need to setup the following variables:
Mandatory variables:
- SMTP_SERVER
- SMTP_USER
- SMTP_PASSWORT
- MAIL_SENDER
- MAIL_TO
Optional variables:
List of used variables:
Add-in codes:
exports.main = function (config, context) {
if (context.device.isGateway) {
config.setScalarByOid("1.2.27.1", context.vars.SMTP_SERVER);
config.setScalarByOid("1.2.27.2", "587");
config.setScalarByOid("1.2.27.12", "2");
config.setScalarByOid("1.2.27.13", "3");
config.setScalarByOid("1.2.27.3", "");
config.setScalarByOid("1.2.27.4", "110");
config.setScalarByOid("1.2.27.11", "");
config.setScalarByOid("1.2.27.5", context.vars.SMTP_USER);
config.setScalarByOid("1.2.27.6", context.vars.SMTP_PASSWORT);
config.setScalarByOid("1.2.27.7", context.vars.MAIL_SENDER);
config.setScalarByOid("1.2.27.8", "30");
config.setScalarByOid("1.2.27.9", "72");
config.setScalarByOid("1.2.27.10", "100");
}
};
|
---|
Add-in as JSON file:
email.json