One of the lesser-known, but really powerful, commands in Text Blaze is the website command. This is definitely one of my personal favorite commands!
It's a favorite because this feature is a huge time-saver, especially if you're working in a system like a CRM or Support tool. You likely already have a lot of data accessible to you in those scenarios, so why not automatically retrieve it using Text Blaze?
Here's a gif showing how easy it is to select the data that you want to add to your snippets:
This post will specifically demonstrate the ability to read the contents of a page as part of your snippet, but this command can also do a few other things, including reading/parsing the HTML of a site, or reading the URL (which can be really useful in if
statements for having a snippet do different things based on the site it's used on).
KEEP IN MIND THAT NONE OF THESE EXAMPLE SNIPPETS WILL WORK HERE ON THE COMMUNITY. Since they're all reading data from sites using CSS selectors, they'll only work on the pages that they were built for. Here's a video of these snippets in action!
Select data from a LinkedIn profile page
This snippet reads the current company as well as the #1 listed skill from someone's LinkedIn profile page. It is using the LinkedIn command pack to get their first name, but that's possible through the site selector as well.
In this case, the data from the site is being merged directly into the text of my snippet.
Hey {linkedin-firstname},
I hear you're doing great things at {site: text; selector=:nth-child(1) > .text-align-left .inline-show-more-text} and was wondering if you're looking for a new role? I'm a recruiter with a great agency and you seem like the perfect fit for a position that I have open. I noticed the top skill on your LinkedIn profile is {site: text; selector=.artdeco-list__item:nth-child(1) [data-field="skill_card_skill_topic"] .hoverable-link-text > :nth-child(1)}, which would be extremely useful in this role.
Reading data from a support tool
In the support tool Intercom, a wide variety of customizable attributes are listed on the right-side of the page when replying to a request. For this example, I'm using the site command inside of an if
statement to determine how to reply to the message.
By reading the Intercom attribute "Product Tier", I can have a different response generated automatically that is appropriate for the user I'm replying to:
{if: {site: text; selector=:nth-child(9) > .overflow-hidden}="Enterprise"}Yes, you do have access to that! That feature is accessible through the side menu. Look for it in the list of features about 2/3rds of the way down the list.
{else}Sorry but that feature is not included in your plan. To access this, you must be on an Enterprise plan. Let me know if you'd like to upgrade.{endif}
Here's a similar example that warns the support agent using the snippet that this person has been in contact with Support a lot lately. This snippet is reading, from Intercom, how many support requests they've had recently. If it's over 10, a warning is displayed to give them extra attention:
{if: {site: text; selector=:nth-child(8) > .overflow-hidden}>10}{note}{error: Note! This customer has been in touch with support more than 10 times in the last 30 days. They may have additional requests open. Please treat them with extra care}{endnote}{else}{endif: trim=left}
Hey {site: text; selector=.font-brand > :nth-child(1)},
Thanks for getting in touch with the Support team. I understand you have an issue with {formmenu: widgets; cogs; buttons; name=issuetype}.
One of the reasons that this is one of my favorite commands is because it's so flexible and requires no coding knowledge. Selecting the portion of CSS you'd like to have as part of your snippet is as simple as pointing your mouse at it. Once selected, this will dynamically merge the data into the snippet for any page that matches (e.g. each unique LinkedIn profile or each unique Intercom support interaction).
If you've used this command before, or have ideas about how you might use it now, reply here to share how!