Send mail notifications via google's gmail
It uses a gmail account to send notification mails.
dpkg-buildpackage -us -uc -b
dpkg -i ../notify-mail_1.2.2_amd64.deb
dpkg -r notify-mail
Get the latest version from https://github.com/adelolmo/notify-mail/releases/latest
dpkg -i notify-mail_1.2.2_amd64.deb
dpkg -i notify-mail_1.2.2_amd64.deb
apt-get remove notify-mail
Follow the instructions here.
apt-get install notify-mail
apt-get remove notify-mail
You will need a gmail account first of all. Make sure that you don't have "two steps authentication" enable.
You need to configure two environment variables:
NOTIFY_MAIL_ACCOUNT
is the mail account used for sending the mails.NOTIFY_MAIL_PASSWORD
is the account's password.
export [email protected]
export NOTIFY_MAIL_PASSWORD=your_password
notify-mail -recipient="email_address@email_provider.com" -subject="Notification" -message="Your message"
Template example:
<html>
<body>
<p1>Hi {{var1}}</p1>
<p1>Here goes the second variable: {{var2}}</p1>
</body>
</html>
notify-mail -recipient="email_address@email_provider.com" -subject="Notification" -template="/path/to/template.html" -variables="{{var1}}=value of var1,{{var2}}=value of var2"
The placeholders var1
and var2
in the template will be replaced by the values given in the variables
parameter.
In the example above var1
will be replaced by the text value of var1
and var2
will be replaced by value of var2
.