]> BookStack Code Mirror - bookstack/blobdiff - app/Activity/Notifications/MessageParts/LinkedMailMessageLine.php
fix Sidebar scrolling at mid-range sceen
[bookstack] / app / Activity / Notifications / MessageParts / LinkedMailMessageLine.php
index 8f6a4e2b9f84723692d41e7b4102ac13fb6fdc53..45ae825710cbddf9ca2ac8c96f5c16baa4143ce5 100644 (file)
@@ -3,13 +3,14 @@
 namespace BookStack\Activity\Notifications\MessageParts;
 
 use Illuminate\Contracts\Support\Htmlable;
+use Stringable;
 
 /**
  * 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
+class LinkedMailMessageLine implements Htmlable, Stringable
 {
     public function __construct(
         protected string $url,
@@ -23,4 +24,10 @@ class LinkedMailMessageLine implements Htmlable
         $link = '<a href="' . e($this->url) . '">' . e($this->linkText) . '</a>';
         return str_replace(':link', $link, e($this->line));
     }
+
+    public function __toString(): string
+    {
+        $link = "{$this->linkText} ({$this->url})";
+        return str_replace(':link', $link, $this->line);
+    }
 }