3 namespace BookStack\Activity\Notifications\MessageParts;
5 use Illuminate\Contracts\Support\Htmlable;
9 * A line of text with linked text included, intended for use
10 * in MailMessages. The line should have a ':link' placeholder for
11 * where the link should be inserted within the line.
13 class LinkedMailMessageLine implements Htmlable, Stringable
15 public function __construct(
16 protected string $url,
17 protected string $line,
18 protected string $linkText,
22 public function toHtml(): string
24 $link = '<a href="' . e($this->url) . '">' . e($this->linkText) . '</a>';
25 return str_replace(':link', $link, e($this->line));
28 public function __toString(): string
30 $link = "{$this->linkText} ({$this->url})";
31 return str_replace(':link', $link, $this->line);