diff --git a/src/Surfnet/Stepup/DateTime/DateTime.php b/src/Surfnet/Stepup/DateTime/DateTime.php index 4a038ec1b..e04cec687 100644 --- a/src/Surfnet/Stepup/DateTime/DateTime.php +++ b/src/Surfnet/Stepup/DateTime/DateTime.php @@ -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. diff --git a/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Identity/Service/RegistrationMailService.php b/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Identity/Service/RegistrationMailService.php index 5fac5c732..2d94876b2 100644 --- a/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Identity/Service/RegistrationMailService.php +++ b/src/Surfnet/StepupMiddleware/CommandHandlingBundle/Identity/Service/RegistrationMailService.php @@ -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, ]; @@ -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, ]; diff --git a/src/Surfnet/StepupMiddleware/MiddlewareBundle/Service/VerifiedSecondFactorReminderMailService.php b/src/Surfnet/StepupMiddleware/MiddlewareBundle/Service/VerifiedSecondFactorReminderMailService.php index a8f9d296a..19df90d0d 100644 --- a/src/Surfnet/StepupMiddleware/MiddlewareBundle/Service/VerifiedSecondFactorReminderMailService.php +++ b/src/Surfnet/StepupMiddleware/MiddlewareBundle/Service/VerifiedSecondFactorReminderMailService.php @@ -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, ]; @@ -153,7 +153,7 @@ private function sendReminderWithRas( string $locale, string $commonName, string $email, - DateTime$requestedAt, + DateTime $requestedAt, string $registrationCode, array $ras, ): void { @@ -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, ];