The following interpolation key is invalid: name

I’m trying to update system_messages.welcome_tl1_user.text_body_template and address the user’s name in the message, but getting the error: The following interpolation key is invalid: name:

Is there a library or doc that I’m missing where we can see which variables can be used in which messages?

1 Like

i think this may be your answer:

5 Likes

Thanks Lilly, that’s a bummer. It would be nice to address the user’s name in some of them.

1 Like

This is not my area but taking a look at ALLOWED_CUSTOM_INTERPOLATION_KEYS it appears you can use additional values for certain messages.

In particular:

    %w[system_messages.welcome_user] => %w[username name name_or_username],

I think if we changed this to:

    %w[system_messages.welcome_] => %w[username name name_or_username],

It would let you use those for other welcome messages. I’ll ask around.

5 Likes

In theory we should be able to add all system_messages.* keys as long as they have subject_template and text_body_template subkeys. Because all of them should be handled by the SystemMessage class which adds username, name, name_or_username as additional interpolation keys.

4 Likes

there we go :slight_smile:

6 Likes

This is indeed the way! Thank you so much for your efforts, Lilly—truly appreciated!

2 Likes

heh well i didn’t do anything other than copy and paste. those other good folks @gerhard, @supermathie and @SaraDev deserve the credit :clap: :sweat_smile:

4 Likes

They say it takes a village!

3 Likes

Could this behavior be extended to chat so notification emails can include the user’s name in the subject instead of their username?

1 Like

you would have to edit the chat email text and change the key from username to their full name. but i have no idea if this is possible. the chat configuration is not my forte. i would go to settings-customize-email and search for a chat email template in the top drop down menu. all the editable email templates are in that drop down.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.