Dynamic Formula help

Hello! I'm a new user, so forgive me if this is a basic question. I've looked at your help section but just can't figure it out.

I want to create a snippet that shows one message if a certain condition exists and a different message if it does not. I am looking to set up this behavior in both (a) a simple formula but also (b) via nested snippets.

For example, I want to create a welcome message that reads,

Thank you for reaching out. I'm sorry for your loss.

when our client is calling about an Estate matter.

But for all other matters, I want the welcome message to read,

Thank you for reaching out. Happy to help!

Will you please share an example of how to accomplish this:

a) with a simple form; and
b) in a nested snippet?

I'll use your example as I set up all our service scripts. Thanks so much!


To be clear, we plan to use this in our email response to a client when a client reaches out. So if a client is reaching out about an "Estate," we will insert snippet A in our email back to the client. But if a client is reaching out about any other issue we handle, we will insert snippet B.

In terms of the nest snippets, we use email scripts with various iterations based on service, payment method, etc, etc. So as we're setting up our snippets, it'll be great to see an example based on the sample scenario I provided in my original post.

I saw the sections in your help section for Form Menu and {if} commands but I couldn't figure out how to fit them together and make them work. Sorry, I'm a beginner! :slight_smile:

As you note there are a couple of approaches. The first would be to create two separate snippets for the two greetings.

If there was shared content between the snippets, you could put that in a third snippet that was imported into the two.

For example:

Greeting 1...

{import: /shared}

Greeting 2...

{import: /shared}

Shared text between the two snippets. It will be imported into both snippets

The second approach would be to use a form to switch between the two messages. Here you just have one snippet and select the greeting when you use it.

{formmenu: Greeting 1; Greeting 2}

Shared Text...

Cool. So that makes sense. I guess, then, what are {if} commands best suited for? In my mind, I was thinking that my situation called for an {if} command which is where I got stuck. If... estate... then... ; but if... not estate... then....

Your above example does the trick. But in terms of {if} commands, when do you recommend them?

Thanks again.

You would want to use an {if} command if you wanted to customize the email in multiple places based on a common condition. For example:

{note}Type: {formmenu: 1; 2; name=type}{endnote}
{if: type == 1}Greeting 1{else}Greeting 2{endif},

Shared Text...

{if: type == 1}Sign off 1{else}Sign off 2{endif},

Thanks. I think that was where I was confused. So an {if} command is better for making one selection that then triggers multiple changes throughout the body of text. And the form menu is better for making one selection that triggers a single change in the body of text. Is that accurate?

Actually let me ask differently, can you give me a clear example where/how I would combine the two - an {if} command with form menu? That may help me get a handle on this. Sorry for the extra questions. I blame being a newbie but also the new formatting language that I need to learn!

The last example actually does combine a {formmenu} and an {if} command. The {formmenu} is used to select which variant you want and the {if} command's customize the contents based on it.

Oops. Sorry. Thank you for all of the help. I think this will give me a great springboard into TB! Have a good weekend.