feat: send all cron reminders over mailjet

This commit is contained in:
fromme committed 2026-11-10 17:13:05 +01:00
1 parent 8b5b7584b1
commit 8898320e21
13 files changed
+27 -9

No files matched your search

@@ -23,8 +23,8 @@ use Psr\Log\LoggerInterface;
* is called inside the visitor's own form submission on another website. A delivery
* confirmation would need machinery nothing else here has.
*
* Goes over MAILER_DSN like every transactional mail; MAILING_MAILER_DSN is for the bulk teamer
* mailing only.
* Goes over MAILER_DSN like every transactional mail; MAILING_MAILER_DSN is for mail sent in
* volume, the teamer mailing and the cron reminders (Mailer::MAILJET_TRANSPORT).
*/
class ApplicationFormSubmissionMailer
{
+8
View File
@@ -14,6 +14,14 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class Mailer
{
/**
* The mailer transport for mail sent in volume - the teamer mailing and the nightly cron
* reminders: Mailjet (MAILING_MAILER_DSN, mailer.yaml), rather than the webhoster's relay that
* carries every other mail, which would risk the hosting account at a few hundred mails. Pass
* it as the 'transport' option.
*/
public const string MAILJET_TRANSPORT = 'mailing';
public function __construct(
private readonly MailerInterface $mailer,
private readonly BodyRendererInterface $bodyRenderer,
@@ -75,7 +75,7 @@ class DispositionReminderService
$this->mailer->createAndSendText(
EmailTextKey::REMINDER_DISPOSITION,
$this->placeholderFactory->forDispositionReminder($disposition, self::REMINDER_LEAD_DAYS),
['to' => $teamer->getCommunication()->getEmail()],
['to' => $teamer->getCommunication()->getEmail(), 'transport' => Mailer::MAILJET_TRANSPORT],
);
}
@@ -81,6 +81,7 @@ class FeedbackReminderService
'to' => $manager->getEmail(),
'subject' => 'Reminder: Offene Feedbacks',
'template' => 'email/reminder_pending_feedback.html.twig',
'transport' => Mailer::MAILJET_TRANSPORT,
]);
}
@@ -65,6 +65,7 @@ class QuestionnaireReminderService
)),
], [
'to' => $email,
'transport' => Mailer::MAILJET_TRANSPORT,
]);
++$count;
@@ -77,6 +77,7 @@ class SeasonTaskReminderService
], [
'subject' => 'Fristen für Saisonunterlagen erreicht',
'template' => 'email/season_deadlines.html.twig',
'transport' => Mailer::MAILJET_TRANSPORT,
]);
$message = 'Sent the season task deadline summary for '.$count.' teamers';
@@ -146,6 +147,7 @@ class SeasonTaskReminderService
'tasks' => implode(', ', $entry['labels']),
], [
'to' => $email,
'transport' => Mailer::MAILJET_TRANSPORT,
]);
++$count;
@@ -107,6 +107,7 @@ class UploadReminderService
{
$this->mailer->createAndSendText($key, $placeholders, [
'to' => $disposition->getTeamer()->getCommunication()->getEmail(),
'transport' => Mailer::MAILJET_TRANSPORT,
]);
}
}
@@ -62,6 +62,7 @@ class WorkMonthReminderService
'workMonth' => $workMonth->getPeriodLabel(),
], [
'to' => $email,
'transport' => Mailer::MAILJET_TRANSPORT,
]);
++$count;
+2 -3
View File
@@ -30,10 +30,9 @@ class TeamerMailingService
/**
* The mailer transport a mailing goes out over: Mailjet, rather than the webhoster's
* relay that carries every other mail, which would risk the hosting account over a few
* hundred recipients. Configured in mailer.yaml.
* relay, see Mailer::MAILJET_TRANSPORT.
*/
private const TRANSPORT = 'mailing';
private const TRANSPORT = Mailer::MAILJET_TRANSPORT;
public function __construct(
private readonly TeamerRepository $teamerRepository,