mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-18 04:31:06 +01:00
Add browser notification for newly arrived mails
This commit is contained in:
parent
d13151aa44
commit
713a9b3a93
@ -575,10 +575,12 @@ app.classes.mail = AppJS.extend(
|
|||||||
{
|
{
|
||||||
let framework = egw_getFramework();
|
let framework = egw_getFramework();
|
||||||
let notify = this.egw.preference('new_mail_notification', 'mail');
|
let notify = this.egw.preference('new_mail_notification', 'mail');
|
||||||
|
const message = egw.lang('New mail from %1', pushData.acl.from)+'\n'+pushData.acl.subject+'\n'+pushData.acl.snippet;
|
||||||
if (typeof notify === 'undefined' || notify === 'always' ||
|
if (typeof notify === 'undefined' || notify === 'always' ||
|
||||||
notify === 'not-mail' && framework && framework.activeApp.appName !== 'mail')
|
notify === 'not-mail' && framework && framework.activeApp.appName !== 'mail')
|
||||||
{
|
{
|
||||||
this.egw.message(egw.lang('New mail from %1', pushData.acl.from)+'\n'+pushData.acl.subject+'\n'+pushData.acl.snippet, 'success');
|
this.egw.message(message, 'success');
|
||||||
|
this.egw.notification(egw.lang('new mail'), {body: message, tag: 'mail', icon: egw.image('navbar', 'mail')});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user