feat: admin editable email templates
addresses #869eg7ptr
This commit is contained in:
1 parent
804dab335f
commit
3e08965e48
49 files changed
+1760
-276
No files matched your search
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Email;
|
||||
|
||||
use App\Entity\Disposition;
|
||||
|
||||
/**
|
||||
* Builds the placeholder maps that more than one caller needs.
|
||||
*
|
||||
* The disposition reminder is sent both by the nightly cron and by
|
||||
* EmailNotificationSubscriber when a contract is confirmed shortly before departure; both
|
||||
* have to fill the same placeholders, and a map that drifts between them would show "-"
|
||||
* in one of the two mails.
|
||||
*/
|
||||
class MailPlaceholderFactory
|
||||
{
|
||||
public function __construct(
|
||||
private readonly int $invoiceUploadDeadlineDays,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string|int|null>
|
||||
*/
|
||||
public function forDispositionReminder(Disposition $disposition, int $diffInDays): array
|
||||
{
|
||||
$assignment = $disposition->getAssignment();
|
||||
$destination = $assignment->getDestination();
|
||||
|
||||
return [
|
||||
'destination' => (string) $destination,
|
||||
'jobProfile' => $assignment->getJobProfile()?->getName(),
|
||||
'product' => $destination->getProduct(),
|
||||
'dateFrom' => $destination->getDateFrom()?->format('d.m.Y'),
|
||||
'dateTo' => $destination->getDateTo()?->format('d.m.Y'),
|
||||
'diffInDays' => $diffInDays,
|
||||
'invoiceUploadDeadlineDays' => $this->invoiceUploadDeadlineDays,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user