Commit 17745203 authored by Tobias Doerffel's avatar Tobias Doerffel Committed by Dietmar Maurer

VZDump: added email notification setting

It's now possible to make VZDump only send a mail in case of a failure.
Signed-off-by: 's avatarTobias Doerffel <tobias.doerffel@ed-chemnitz.de>
parent b583d6f7
......@@ -268,6 +268,8 @@ sub sendmail {
}
}
return if (!$ecount && !$err && $opts->{mailnotification} eq 'failure');
my $stat = ($ecount || $err) ? 'backup failed' : 'backup successful';
$stat .= ": $err" if $err;
......@@ -1134,6 +1136,13 @@ my $confdesc = {
description => "",
optional => 1,
},
mailnotification => {
type => 'string',
description => "Specify when to send an email",
optional => 1,
enum => [ 'always', 'failure' ],
default => 'always',
},
tmpdir => {
type => 'string',
description => "Store temporary files to specified directory.",
......
......@@ -160,6 +160,13 @@ Ext.define('PVE.dc.BackupEdit', {
fieldLabel: gettext('Send email to'),
name: 'mailto'
},
{
xtype: 'pveEmailNotificationSelector',
fieldLabel: gettext('Email notification'),
name: 'mailnotification',
deleteEmpty: me.create ? false : true,
value: me.create ? 'always' : ''
},
{
xtype: 'pveCompressionSelector',
fieldLabel: gettext('Compression'),
......
Ext.define('PVE.form.EmailNotificationSelector', {
extend: 'PVE.form.KVComboBox',
alias: ['widget.pveEmailNotificationSelector'],
initComponent: function() {
var me = this;
me.data = [
['always', gettext('Always')],
['failure', gettext('On failure only')]
];
me.callParent();
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment