Notifications: Add configuration for account / address to use for sending notification emails

If the app specifies a different sender (Calendar) that is still used instead.

(cherry picked from commit 7d15c2f352)
This commit is contained in:
nathangray
2021-06-08 10:22:48 -06:00
parent 26e186fb8c
commit 1bed2d2df6
3 changed files with 34 additions and 1 deletions

View File

@ -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;