fix: missing date in mail (#753)

This commit is contained in:
JacquesDurand 2024-10-07 15:40:18 +02:00 committed by Hugo Nicolas
parent 6648b44d8a
commit 779d46fc34
No known key found for this signature in database
GPG key ID: 09CB3D93EB8B0E61
3 changed files with 6 additions and 3 deletions

View file

@ -6,7 +6,7 @@ metadata:
labels:
{{- include "plateforme-ebs.labels" . | nindent 4 }}
spec:
schedule: '30 14 * * *'
schedule: '17 1 * * *'
timeZone: "Europe/Paris"
jobTemplate:
metadata:

View file

@ -77,6 +77,9 @@ class EndPlatformMembershipCommand extends Command
$user->getEmail(),
));
// save it here for the mail before setting it back to null
$endAt = $user->getEndAt();
$user->setMembershipPaid(false)
->setEndAt(null)
->setPayedAt(null)
@ -85,7 +88,7 @@ class EndPlatformMembershipCommand extends Command
$this->userManager->save($user, true);
$this->appMailer->send(EndPlatformMembershipMail::class, compact('user', 'platform'));
$this->appMailer->send(EndPlatformMembershipMail::class, compact('user', 'platform', 'endAt'));
$this->sendSms($user, EndPlatformMembershipMail::class, ['%platform%' => $platform]);
++$count;
}

View file

@ -4,7 +4,7 @@
<p>{{ (i18n_prefix ~ '.h1')|trans }}</p>
<p>{{ (i18n_prefix ~ '.p1')|trans({'%endAt%': user.endAt, '%platform%': platform}) }}</p>
<p>{{ (i18n_prefix ~ '.p1')|trans({'%endAt%': endAt|date('d-m-Y H:i:s'), '%platform%': platform}) }}</p>
<a href="{{ url('app_login') }}">{{ (i18n_prefix ~ '.loginLink')|trans }}</a>