Adding custom vars to email templates? User email confirmation FRONTEND_URL use case

Hello,

I would like to be able to add custom vars to the e-mail templates of the user-permission confirmation and reset password templates.

I’m using Strapi v5 through an Astro front-end, so the Strapi confirm link will not be immediately visible to end users who need to click on the e-mail link.

A solution would be being able to define custom vars such as the provided <%= CODE %>, for example <%= FRONTEND_URL %> that would be available globally.

Without this, I think I need to hard code these values between dev and staging.

This seems to be a common use case and a recurring question: Email Template Variables / lodash and here Customising Email-Confirmation template strapi5

I was checking the code and it seems that the isValidTemplate function only accepts these values:

const authorizedKeys = [
‘URL’,
‘ADMIN_URL’,
‘SERVER_URL’,
‘CODE’,
‘USER’,
‘USER.email’,
‘USER.username’,
‘TOKEN’,
];

I’m guessing it is for security reasons, for now I will hard code my values inside the mails, although I think it is not ideal.