flexisip-account-manager/flexiapi/app/Mail/Voicemail.php
Timothée Jaussoin eeeb6baf74 Fix FLEXIAPI-366 Send the voicemails by email
Add a Voicemail UI to listen and delete voicemails in the Admin Account view
2025-12-11 17:20:56 +01:00

44 lines
1 KiB
PHP

<?php
namespace App\Mail;
use App\AccountFile;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
use Illuminate\Mail\Mailables\Attachment;
class Voicemail extends Mailable
{
use Queueable, SerializesModels;
public function __construct(public AccountFile $accountFile)
{
}
public function envelope(): Envelope
{
return new Envelope(
subject: $this->accountFile->account->space->name .
': ' .
__('New voice message from :sipfrom', ['sipfrom' => $this->accountFile->sip_from]),
);
}
public function content(): Content
{
return new Content(
markdown: 'mails.voicemail',
);
}
public function attachments(): array
{
return [
Attachment::fromStorage($this->accountFile->path)
->withMime($this->accountFile->content_type)
];
}
}