Skip to content

Commit

Permalink
Fix mail date format
Browse files Browse the repository at this point in the history
  • Loading branch information
pablothedude committed Nov 20, 2024
1 parent d4b8d6c commit 563c627
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/Surfnet/Stepup/DateTime/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class DateTime implements Stringable
* `DateTime::createFromString()`.
*/
public const FORMAT = 'Y-m-d\\TH:i:sP';
public const MAIL_FORMAT = 'Y-m-d H:i:s';

/**
* Allows for mocking of time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private function sendRegistrationEmailWithRas(
'commonName' => $commonName,
'emailAddress' => $email,
'registrationCode' => $registrationCode,
'expirationDate' => $expirationDate,
'expirationDate' => $expirationDate->format(DateTime::MAIL_FORMAT),
'ras' => $ras,
'selfServiceUrl' => $this->selfServiceUrl,
];
Expand Down Expand Up @@ -208,7 +208,7 @@ private function sendRegistrationEmailWithRaLocations(
'commonName' => $commonName,
'emailAddress' => $email,
'registrationCode' => $registrationCode,
'expirationDate' => $expirationDate,
'expirationDate' => $expirationDate->format(DateTime::MAIL_FORMAT),
'raLocations' => $raLocations,
'selfServiceUrl' => $this->selfServiceUrl,
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private function sendReminderWithInstitution(
'templateString' => $emailTemplate->htmlContent,
'locale' => $locale,
'commonName' => $commonName,
'expirationDate' => $requestedAt,
'expirationDate' => $requestedAt->format(DateTime::MAIL_FORMAT),
'registrationCode' => $registrationCode,
'raLocations' => $raLocations,
];
Expand All @@ -153,7 +153,7 @@ private function sendReminderWithRas(
string $locale,
string $commonName,
string $email,
DateTime$requestedAt,
DateTime $requestedAt,
string $registrationCode,
array $ras,
): void {
Expand All @@ -174,7 +174,7 @@ private function sendReminderWithRas(
'templateString' => $emailTemplate->htmlContent,
'locale' => $locale,
'commonName' => $commonName,
'expirationDate' => $requestedAt,
'expirationDate' => $requestedAt->format(DateTime::MAIL_FORMAT),
'registrationCode' => $registrationCode,
'ras' => $ras,
];
Expand Down

0 comments on commit 563c627

Please sign in to comment.