How to use the {error} command

Hey everyone :waving_hand:

Did you know that with Text Blaze, you can create snippets that help with validation and quality assurance?

We introduced new error message formats (warning, info, success) that can show up based on pre-defined rules, help you avoid mistakes, and even block snippet insertion :white_check_mark:

We know that calling it the {error} command when it can now also show success messages is a bit ironic. We're committed to the bit at this point :laughing:

Check it out:

For example, in the snippet below, a different, relevant error message is shown depending on your selection in the drop-down menu. Plus, if you select ‘Bulk’ and enter a discount percentage greater than 30%, snippet insertion will be blocked until you change the number in the form field.

Hi there,

Thanks for reaching out to us here at ACME. We've received your order and expect it to ship in 5-7 business days.

{note: color=none}Order type: {formmenu: default=Standard; Express; Bulk; name=Order Type}

{endnote}{if: `Order Type` = "Standard"}Your order will be processed under our standard shipping timeline.{if: `additional details`=""}

{error: Verify shipping address; type=error}{endif}{elseif: `Order Type` = "Express"}Your order qualifies for express shipping and will be prioritized for faster delivery.{if: `additional details`=""}

{error: Provide express tracking #; type=warning}{endif}{elseif: `Order Type` = "Bulk"}Your bulk order will be handled by our special logistics team. We’ll contact you shortly with details.{if: `additional details`=""}

{error: Offer discount for future orders; type=info}{endif}{else}Please select a valid order type.{endif}

{formparagraph: name=Additional Details; cols=50}

{if: `Order Type` = "Bulk"}We can offer you a discount of {formtext: name=Discount %}% off your next order.

{if: `discount %`>30}{error: We cannot offer discounts greater than 30%. Verify information.; block=yes}{elseif: `discount %`<30 AND `discount %`> 1}{note}{error: Good to go!; type=success}{endnote}{elseif: `discount %`=""}
{endif}{endif}

Best regards,
ACME Customer Support

Using Text Blaze’s {error} and {if} commands, you can create templates that help you avoid mistakes and get to the right message in every interaction! :fire:

Give it a try and let us know if you need any help! :smiley: