Ваша единственная опция - лямбда-функция и ее подключение к общим настройкам -> Триггеры -> Пользовательское сообщение в вашем пуле пользователей.
Пример лямбда-функции:
exports.handler = (event, context, callback) => {
// https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-message.html
// dev
if(event.userPoolId === "YOUR USER POOL ID") {
// Identify why was this function invoked
if(event.triggerSource === "CustomMessage_ForgotPassword") {
if(event.request.userAttributes.locale === "fr-CA")
{
event.response.smsMessage = "Votre code de confirmation est: " + event.request.codeParameter;
event.response.emailSubject = "Code de confirmation";
event.response.emailMessage = "Votre code de confirmation: " + event.request.codeParameter + "<br/><br/>Veuillez visiter cette URL et fournir les informations demandées: ~your url~";
}
else
{
event.response.smsMessage = "Your confirmation code is: " + event.request.codeParameter;
event.response.emailSubject = "Confirmation Code";
event.response.emailMessage = "Your confirmation code: " + event.request.codeParameter + "<br/><br/>Please visit this url and provide the requested information: ~your url~";
}
}
// Create custom message for other events
}
// qa
// prod
// Return to Amazon Cognito
callback(null, event);
};