laravel-notification-channels / telegram

✈️ Telegram Notifications Channel for Laravel
https://laravel-notification-channels.com/telegram/
MIT License
964 stars 162 forks source link

Addition of 'lineIf' method to messages #190

Closed MammutAlex closed 6 months ago

MammutAlex commented 6 months ago

This pull request introduces a new method called 'lineIf' to the codebase. The 'lineIf' method adds a line to the content if the first argument evaluates to true. This enhancement is inspired by a similar method found in Laravel's MailMessage class (https://laravel.com/api/10.x/Illuminate/Notifications/Messages/MailMessage.html#method_lineIf)

 TelegramMessage::create()
            ->to($notifiable->telegram_user_id)
            ->lineIf($this->amount > 0, "Amount paid: {$this->amount}");
irazasyed commented 6 months ago

Nice addition ✨👍🏻