1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-10-31 03:50:27 +03:00
Files
bookstack/app/Activity/Notifications/LinkedMailMessageLine.php
Dan Brown 9779c1a357 Notifications: Started core user notification logic
Put together an initial notification.
Started logic to query and identify watchers.
2023-08-04 12:27:29 +01:00

27 lines
677 B
PHP

<?php
namespace BookStack\Activity\Notifications;
use Illuminate\Contracts\Support\Htmlable;
/**
* A line of text with linked text included, intended for use
* in MailMessages. The line should have a ':link' placeholder for
* where the link should be inserted within the line.
*/
class LinkedMailMessageLine implements Htmlable
{
public function __construct(
protected string $url,
protected string $line,
protected string $linkText,
) {
}
public function toHtml(): string
{
$link = '<a href="' . e($this->url) . '">' . e($this->linkText) . '</a>';
return str_replace(':link', $link, e($this->line));
}
}