feat: send accepted teamer invoices to configurable email inbox
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
class EmailAttachmentDto
|
||||
use App\Email\EmailAttachmentInterface;
|
||||
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
|
||||
|
||||
class EmailAttachmentDto implements EmailAttachmentInterface
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $name,
|
||||
@@ -25,4 +30,9 @@ class EmailAttachmentDto
|
||||
{
|
||||
return $this->mimeType;
|
||||
}
|
||||
|
||||
public function attachTo(TemplatedEmail $email): void
|
||||
{
|
||||
$email->attach($this->content, $this->name, $this->mimeType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use App\Email\EmailAttachmentInterface;
|
||||
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
|
||||
|
||||
class EmailPathAttachmentDto implements EmailAttachmentInterface
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $path,
|
||||
private readonly string $name,
|
||||
private readonly string $mimeType = 'application/pdf',
|
||||
) {
|
||||
}
|
||||
|
||||
public function getPath(): string
|
||||
{
|
||||
return $this->path;
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getMimeType(): string
|
||||
{
|
||||
return $this->mimeType;
|
||||
}
|
||||
|
||||
public function attachTo(TemplatedEmail $email): void
|
||||
{
|
||||
$email->attachFromPath($this->path, $this->name, $this->mimeType);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user