X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fenotify.php;h=e21adc91ac64fe07dbcfc2e2aad7f6166f34dc56;hb=34f4aedb87e403ef276fa780bcaaeb280336c0f4;hp=f55c9f6ccdc0a000cc73ab0ca9e2640101b4e134;hpb=2b8f0677158feff781478898e1d58e1bb2100c96;p=friendica.git diff --git a/include/enotify.php b/include/enotify.php index f55c9f6ccd..e21adc91ac 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -15,10 +15,8 @@ use Friendica\Model\ItemContent; use Friendica\Model\Notify; use Friendica\Model\User; use Friendica\Model\UserItem; -use Friendica\Object\EMail; +use Friendica\Object\Email; use Friendica\Protocol\Activity; -use Friendica\Util\DateTimeFormat; -use Friendica\Util\Emailer; /** * Creates a notification entry and possibly sends a mail @@ -485,23 +483,24 @@ function notification($params) if ($show_in_notification_page) { $notification = DI::notify()->insert([ - 'name' => $params['source_name'], - 'url' => $params['source_link'], - 'photo' => $params['source_photo'], - 'uid' => $params['uid'], - 'iid' => $item_id, - 'parent' => $parent_id, - 'type' => $params['type'], - 'verb' => $params['verb'], - 'otype' => $params['otype'], + 'name' => $params['source_name'] ?? '', + 'name_cache' => strip_tags(BBCode::convert($params['source_name'] ?? '')), + 'url' => $params['source_link'] ?? '', + 'photo' => $params['source_photo'] ?? '', + 'link' => $itemlink ?? '', + 'uid' => $params['uid'] ?? 0, + 'iid' => $item_id ?? 0, + 'parent' => $parent_id ?? 0, + 'type' => $params['type'] ?? '', + 'verb' => $params['verb'] ?? '', + 'otype' => $params['otype'] ?? '', ]); - $notification->link = DI::baseUrl() . '/notification/view/' . $notification->id; - $notification->msg = Renderer::replaceMacros($epreamble, ['$itemlink' => $notification->link]); + $notification->msg = Renderer::replaceMacros($epreamble, ['$itemlink' => $notification->link]); DI::notify()->update($notification); - $itemlink = $notification->link; + $itemlink = DI::baseUrl() . '/notification/' . $notification->id; $notify_id = $notification->id; } @@ -610,7 +609,7 @@ function notification($params) '$content_allowed' => $content_allowed, ]); - $email = new EMail($sender_name, $sender_email, $sender_email, $params['to_email'], + $email = new Email($sender_name, $sender_email, $sender_email, $params['to_email'], $datarray['subject'], $email_html_body, $email_text_body, $datarray['headers'], $params['uid']);