mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 14:33:14 +00:00
Fix unit tests
This commit is contained in:
@@ -82,19 +82,24 @@ class eventsmanager_notify_bridgeuploadfail extends eventsmanager_notifyAbstract
|
||||
$mailed = false;
|
||||
|
||||
if ($this->shouldSendNotificationFor($params['usr_id'])) {
|
||||
$user = User_Adapter::getInstance($params['usr_id'], $this->app);
|
||||
|
||||
$readyToSend = false;
|
||||
try {
|
||||
$user = User_Adapter::getInstance($params['usr_id'], $this->app);
|
||||
$account = Bridge_Account::load_account($this->app, $params['account_id']);
|
||||
$readyToSend = true;
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
if ($readyToSend) {
|
||||
$receiver = Receiver::fromUser($user);
|
||||
/** ADD MAIL TEST */
|
||||
$mail = MailInfoBridgeUploadFailed::create($this->app, $receiver);
|
||||
$mail->setAdapter($account->get_api()->get_connector()->get_name());
|
||||
$mail->setReason($params['reason']);
|
||||
$this->app['notification.deliverer']->deliver($mail);
|
||||
$mailed = true;
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user