diff --git a/notifications/inc/class.notifications.inc.php b/notifications/inc/class.notifications.inc.php
index ac9ecec83c..d1f87507c4 100644
--- a/notifications/inc/class.notifications.inc.php
+++ b/notifications/inc/class.notifications.inc.php
@@ -215,6 +215,14 @@ class notifications {
* it's an int with the account id or the e-mail address of a non-eGW user
*/
public function set_sender($_sender) {
+ // Check configured sender first - that overrides all
+ $config = Api\Config::read('notifications');
+ if($config && ($config['async_account' || $config['async_email']]))
+ {
+ $send_user = $config['async_account'];
+ $email = $config['async_email'] ?: $GLOBALS['egw']->accounts->id2name($send_user,'account_email');
+ }
+
if(is_object($_sender)) {
$this->sender = $_sender;
return true;
diff --git a/notifications/inc/class.notifications_email.inc.php b/notifications/inc/class.notifications_email.inc.php
index 615f748f20..f86e048b91 100644
--- a/notifications/inc/class.notifications_email.inc.php
+++ b/notifications/inc/class.notifications_email.inc.php
@@ -76,7 +76,21 @@ class notifications_email implements notifications_iface {
{
unset($this->mail);
}
- $this->mail = new Api\Mailer();
+
+ // Use configured mail ac
+ $ident = null;
+ if($this->config->async_account)
+ {
+ $mail_identities = Api\Mail\Account::identities([], true, 'params', $this->config->async_account);
+ foreach ($mail_identities as $mi)
+ {
+ if ($mi['ident_email'] == $this->config->async_email || !$this->config->async_email)
+ {
+ $ident = Api\Mail\Account::read($mi['acc_id']);
+ }
+ }
+ }
+ $this->mail = new Api\Mailer($ident);
}
/**
diff --git a/notifications/templates/default/config.xet b/notifications/templates/default/config.xet
index f9cc1afd42..b82bf8e616 100644
--- a/notifications/templates/default/config.xet
+++ b/notifications/templates/default/config.xet
@@ -31,6 +31,17 @@
+
+
+
+
+
+
+
+
+
+
+