Can I use {{ connection.metadata }} inside custom email templates?

I set some metadata at my connection, and want to use the metadata in custom emails from each connection. Is there a way to access this variable in custom email templates?

At this time, connection metadata is not available as far as I’m aware. Per (https://auth0.com/docs/auth0-email-services/customize-email-templates#common-variables) the name of the connection may be available in some templates, but not metadata.

You should leave feedback about your use case through auth0.com/feedback.

1 Like

You know if I can make it available in any way? Using a rule, per example.

I don’t believe there would be a way; what’s your overall use case? As in, what’s the requirement behind the need for different templates? There may be alternative flows, but with regards to connection metadata in templates I don’t believe that would be possible.

My application can be configured as a whitelabel. Then I create via API a connection for each customer. That way, the same email could have different passwords for each landing page (whitelabel). What I lack is to be able to customize the account confirmation emails with color, logo and redirect url for each customer.

I see, I’m afraid the white-label scenario is one where at this time we don’t have a really good story for if using a single tenant for all the white-label applications. It could technically be possible to achieve greater white-label flexibility by having individual tenants, but managing/having multiple tenants may also get complex fast.

Another current limitation for white-label within a single tenant is that each tenant can only be configured with one custom domain and in some situation you would likely want a customized custom domain as well.

I understand, this here was my last hope, already had studied a little.

Last question. Do you know if I can request from an API using the liquid syntax inside the email template? Or using a rule?

Rules can indeed perform external API calls and in the scope of rules I believe connection metadata is even available, however, to my knowledge you won’t be able to do that from the email templates themselves.