40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
use App\Models\SubmitTool;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Notifications\Notification;
|
|
use NotificationChannels\Telegram\TelegramMessage;
|
|
|
|
class AiToolSubmitted extends Notification
|
|
{
|
|
use Queueable;
|
|
|
|
protected $submit_tool;
|
|
|
|
/**
|
|
* Create a new notification instance.
|
|
*/
|
|
public function __construct(SubmitTool $submit_tool)
|
|
{
|
|
$this->submit_tool = $submit_tool;
|
|
}
|
|
|
|
/**
|
|
* Get the notification's delivery channels.
|
|
*
|
|
* @return array<int, string>
|
|
*/
|
|
public function via(object $notifiable): array
|
|
{
|
|
return ['telegram'];
|
|
}
|
|
|
|
public function toTelegram($notifiable)
|
|
{
|
|
return TelegramMessage::create()
|
|
->content("*AI Tool Submitted*:\nURL: ".$this->submit_tool->submitted_url."\nBy: ".$this->submit_tool->social.' in '.$this->submit_tool->social_type."\nEmail: ".$this->submit_tool->email."\nFound us from: ".$this->submit_tool->source.' from '.$this->submit_tool->source_type."\n\nComments: ".$this->submit_tool->comments);
|
|
}
|
|
}
|