[Unit]
Description=Email alert service
# trigger with OnFailure=email-alert@%n.service
Requires=network-online.target
AssertFileNotEmpty=/opt/email-alert/mutt.cfg
AssertFileNotEmpty=/opt/email-alert/recipients.cfg
User=root

[Service]
Type=oneshot

PrivateTmp=true
PrivateDevices=true
ProtectSystem=full
ProtectHome=true
NoNewPrivileges=true

WorkingDirectory=/opt/email-alert/

ExecStart=/opt/email-alert/email-alert.sh %H %I

[Install]
WantedBy=multi-user.target