PIN is not sent via notification

Hello, I have an event set up to send an email, where I have a message defined with the tag “{pin}”, but the PIN has a “None” value in the message.

Event handler setting:
Events: token_init, token_assign, token_setpin
Handler module: UserNotification
Position: post
Condition: token_has_owner:True, tokentype:sms
Action:sendmail
To:tokenowner
Body: Dear {username}, your initialization PIN is {pin} for your SMS token (serial number:{serial}). {admin}
Detail info: {date} {time}, {action}, token {serial} ({tokentype}: {tokendescription}), {registrationcode}

Mail message after set PIN to user:
Dear Testuser, your initialization PIN is None for your SMS token (serial number:PISM000XXXXX). PIAdmin
Detail info: 2026-03-01 00:25:02, /token/setpin/PISM000XXXXX, token PISM000XXXXX (sms: user sms token description), None

Thank you for any solution.
T