feat: add custom description to gateway notifications

Support custom signer descriptions in SMS, Signal, Telegram, WhatsApp,
and XMPP notifications. The description is prepended to the notification
message when provided, allowing personalized instructions through all
supported notification channels.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This commit is contained in:
Vitor Mattos 2025-12-16 17:06:47 -03:00
parent a4d5a5f854
commit 960af717bc
No known key found for this signature in database
GPG key ID: 6FECE2AD4809003A

View file

@ -81,10 +81,16 @@ class TwofactorGatewayListener implements IEventListener {
}
$isFirstNotification = $this->signRequestMapper->incrementNotificationCounter($signRequest, $entity->getIdentifierKey());
$message = '';
if (!empty($signRequest->getDescription())) {
$message = $signRequest->getDescription() . "\n\n";
}
if ($isFirstNotification) {
$message = $this->l10n->t('There is a document for you to sign. Access the link below:');
$message .= $this->l10n->t('There is a document for you to sign. Access the link below:');
} else {
$message = $this->l10n->t('Changes have been made in a file that you have to sign. Access the link below:');
$message .= $this->l10n->t('Changes have been made in a file that you have to sign. Access the link below:');
}
$message .= "\n";
$link = $this->urlGenerator->linkToRouteAbsolute('libresign.page.sign', ['uuid' => $signRequest->getUuid()]);