Text Blaze Feature of the Week #5: Re-using snippets in other snippets

Hey Text Blaze community :fire:

It's week 5 of the Text Blaze Feature of the Week series where I post weekly about cool features to showcase all the awesome stuff you can do with Text Blaze :sunglasses:

Text Blaze Feature of the Week #5: Import Command

Do you find yourself typing the same text in multiple snippets? If so, the import command is going to be your best friend :wink:

The import command is helpful if you want to include a snippet within another snippet. Instead of re-typing your email signature into each and every snippet you use, you can simply create a snippet for the signature itself and import it into all of your other ones.

What's even cooler is that if you have a snippet imported into multiple snippets (such as an email signature), you only need to edit the imported snippet to update all of the others.

import-command

Three things to know about the import command:

  1. You can edit snippets that are imported into other snippets and the changes will be made live in all snippets.

  2. The import command can be used with forms and the if command to conditionally include content that depends on your form input. (See the last snippet)

  3. Import is different from the snippet command, which provides information about your snippets within the snippets themselves.

Snippet: /mysig

Dylan Cable
Head of Community at Text Blaze
Start Today to Eliminate Repetitive Typing Forever

Snippet: /newcustomer

Hey there!

I'm happy to tell you more about how Text Blaze works. Let's hop on a call to discuss this.

Here's my calendar link.

Snippet: /oldcustomer

Hey there!

I hope you're enjoying Text Blaze. Let me know if there's anything I can do to help!

Please visit our guides and YouTube channel for more information as well :slight_smile:

Master snippet (imports the others depending on the selection)

{note} {formmenu: New Customer; Old Customer; name=customerstatus}{endnote: trim=yes}

{if: customerstatus = "New Customer"} {import: /newcustomer} {else} {import: /oldcustomer}{endif}

{import: /mysig}

1 Like

Can I use the import command in a drop-down menu? Can create a list of snippets inside of a snippet that I want to choose from to build out a dynamic prompt? For example, if I'm building out an AI prompt and I have a list of 5 target audiences (that are 5 different snippets) and a list of 5 brand voices (that are also 5 other different prompts), can I have a drop-down for 5 target audiences and 5 brand voices inside of that prompt that I can choose from?

Hi Joel,

At this time, you cannot add the import command in a drop down menu to trigger snippets from within other snippets. That is an interesting idea though.

For now, you can use something like the snippet below that does something similar. Please let me know if it works for you.

{note}Target Audience: {formmenu: default=Healthcare; Sales; Education; name=target audience}
Brand Voice: {formmenu: default=Professional; Funny; Knowledgable; name=brand voice}{endnote}

{if: `target audience` = "Healthcare"; trim=right}
When the menu selection is "Healthcare", this will show.
{elseif: `target audience` = "Sales"; trim=yes}
When the menu selection is "Sales", this will show.
{elseif: `target audience` = "Education"; trim=yes}
When the menu selection is "Education", this will show.
{endif: trim=left}

{if: `brand voice` = "Professional"; trim=right}
When the menu selection is "Professional", this will show.
{elseif: `brand voice` = "Funny"; trim=yes}
When the menu selection is "Funny", this will show.
{elseif: `brand voice` = "Knowledgable"; trim=yes}
When the menu selection is "Knowledgable", this will show.
{endif: trim=left}

1 Like

Thanks Dylan!

1 Like