Is it possible to change From field dynamically in Email Templates(Change Password)?

I’m trying to change From field according as some conditions(like user.app_metadata.is_foo) with Liquid.

The type of is_foo is boolean

But I’ve got the following error message when clicking Try button. It looks like the Liquid syntax is not supported in From field.

The value {% if user.app_metadata.is_foo %} FOO <noreply@foo.com> {% else %} BAZ <noreply@baz.com> {% endif %}
is not valid for the From field.
Possible values: an email address ('support@yourapp.com') or a prefix and an email address between <> ('Your App <support@yourapp.com>')

Is it possible to change From field dynamically in Email Templates(Change Password)?

Hey there @emag!

Not sure if it can be changed dynamically but let me research it and get back to you with an answer!

1 Like

Hey again!

After some internal discussions and visiting this doc:

liquid syntax is is available in from field. The From Address field supports all the common variables for templates.

Hi, Konrad!

Thank you for your investigation.

Unfortunately, it looks like the situation hasn’t changed.

Steps to reproduce:

  1. Input the string including Liquid tag in From field on Change Password Email Template
{% if user.app_metadata.is_foo %} FOO <noreply@foo.com> {% else %} BAZ <noreply@baz.com> {% endif %}

noreply@foo.com and noreply@baz.com are just examples. I replace them with valid addresses.

  1. Click SAVE
  2. Click TRY and show the error message

  1. Click TRY in the dialogue but I never receive the mail

Thank you a lot for providing all that information. Let me dive into it once again and get back to you once I have news to share!

1 Like

I was able to get the same results. It seems that either there is something wrong with our stack or the doc itself. I’ll make sure to report it internally!

1 Like

Hi, @konrad.sopala ! Any update on this? Thanks!

1 Like

Hey there!

Let me circle back with the team to see where it went in the meantime!

2 Likes

Hi @konrad.sopala! Updates on this issue and possible solution is so much needed here as well. Thanks.

I don’t think it’s fully correct. When I try to use support_email variable in the From field I get a similar message as the topic starter

Alright, let me push not only docs team but also the team responsible for email templates as there certainly is a problem not only with docs

1 Like

Hi. Was this ever resolved?

Not really… Let me chase it once again and ping appropriate team! Will come back here as soon as I have any news to share!

We only support variables as part of the “prefix” part (the display name) of the From address:

  • Supported:

{{ application.name }} <someone@test.com>

  • Not supported:

Some Company <someone@ {{ application.name }} .com>
{{ application.name }} @test.com

When it comes to dynamic change of FROM field, it’s unfortunately not possible.

You can file it as a feature request here:

1 Like

Hi,

I have done something similar to this, let us know if it gets resolved or not?

1 Like