Skip to content

Commit fbf81e4

Browse files
authored
line function added (laravel-notification-channels#149)
1 parent 825c8b3 commit fbf81e4

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ class InvoicePaid extends Notification
156156
// Optional recipient user id.
157157
->to($notifiable->telegram_user_id)
158158
// Markdown supported.
159-
->content("Hello there!\nYour invoice has been *PAID*")
159+
->content("Hello there!")
160+
->line("Your invoice has been *PAID*")
161+
->line("Thank you!")
160162

161163
// (Optional) Blade template for the content.
162164
// ->view('notification', ['url' => $url])

src/TelegramMessage.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ public function content(string $content, int $limit = null): self
4242
return $this;
4343
}
4444

45+
public function line(string $content): self
46+
{
47+
$this->payload['text'] .= $content."\n";
48+
49+
return $this;
50+
}
51+
4552
/**
4653
* Attach a view file as the content for the notification.
4754
* Supports Laravel blade template.

0 commit comments

Comments
 (0)