You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virt/web/app/Services/Ticket/TicketNotificationTransport...

29 lines
662 B
PHP

<?php
namespace App\Services\Ticket;
use App\Services\Mail;
use App\Services\TicketTelegramNotifier;
final class TicketNotificationTransportAdapter implements TicketNotificationTransport
{
public function sendMail(
string $email,
string $subject,
string $template,
array $data,
?string $event = null
): void {
Mail::send($email, $subject, $template, $data, [], $event);
}
public function sendTelegram(
string $event,
int $ticketId,
string $title,
string $content
): void {
TicketTelegramNotifier::notify($event, $ticketId, $title, $content);
}
}