{"id":213,"date":"2026-04-01T06:04:41","date_gmt":"2026-04-01T06:04:41","guid":{"rendered":"https:\/\/text.email\/blog\/?p=213"},"modified":"2026-04-01T21:09:14","modified_gmt":"2026-04-01T21:09:14","slug":"sms-formatting","status":"publish","type":"post","link":"https:\/\/text.email\/blog\/sms-formatting\/","title":{"rendered":"SMS Formatting: Customize How text.email Converts Emails into Texts"},"content":{"rendered":"\n<p>If you&#8217;re using text.email to <a href=\"https:\/\/text.email\/blog\/email-to-text\/\" data-type=\"post\" data-id=\"16\">turn emails into text messages<\/a>, when we convert an email into text, the default format works like this:<\/p>\n\n\n\n<p><code>{subject}: {body}<\/code><\/p>\n\n\n\n<p>Sometimes that&#8217;s all good. But sometimes, well, <strong>the emails that your systems generate can get a little (or a lot) wordy<\/strong>. (Give the machines a break. They&#8217;re lonely. They need someone to talk to.)<\/p>\n\n\n\n<p>The messages will often include timestamps, headers, footers, status codes, account metadata, and more \u2014 and your phone buzzes with all of it crammed into one long SMS. Or, even worse, split across multiple texts.<\/p>\n\n\n\n<p><strong>SMS formatting in text.email gives you control of exactly what shows up in the text<\/strong>.<\/p>\n\n\n\n<p>You write a short template, and text.email uses it instead of the default. And with <strong>regex extraction<\/strong> feature, you can go a step further and pull one specific value out of the email body.<\/p>\n\n\n\n<p>Here&#8217;s how it works.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"table-of-contents\">SMS Formatting: Table of Contents<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#basic\">How to Create a Basic text.email Email-to-SMS Formatting Template<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#variables\">Using the text.email variables<\/a><\/li>\n\n\n\n<li><a href=\"#truncating\">Automatically truncating longer messages<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#advanced\">How to Create an Advanced SMS Formatting Template with Regex<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#regex\">Regex formatting in text.email<\/a><\/li>\n\n\n\n<li><a href=\"#combining\">Combining all the formatting skills into a single template<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"http:\/\/getting-started\">Getting Started with SMS Formatting in text.email<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"basic\">How to Create a Basic text.email Email-to-SMS Formatting Template<\/h2>\n\n\n\n<p>Head to your text.email Settings page.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/text.email\/blog\/wp-content\/uploads\/2026\/04\/smsformatting-settings-tinified.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"544\" src=\"https:\/\/text.email\/blog\/wp-content\/uploads\/2026\/04\/smsformatting-settings-tinified-1024x544.png\" alt=\"\" class=\"wp-image-219\" srcset=\"https:\/\/text.email\/blog\/wp-content\/uploads\/2026\/04\/smsformatting-settings-tinified-1024x544.png 1024w, https:\/\/text.email\/blog\/wp-content\/uploads\/2026\/04\/smsformatting-settings-tinified-300x159.png 300w, https:\/\/text.email\/blog\/wp-content\/uploads\/2026\/04\/smsformatting-settings-tinified-768x408.png 768w, https:\/\/text.email\/blog\/wp-content\/uploads\/2026\/04\/smsformatting-settings-tinified-1536x816.png 1536w, https:\/\/text.email\/blog\/wp-content\/uploads\/2026\/04\/smsformatting-settings-tinified.png 2004w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>Scroll down and you&#8217;ll see the <strong>SMS formatting <\/strong>section.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"784\" src=\"https:\/\/text.email\/blog\/wp-content\/uploads\/2026\/04\/smsformatting-onsettingspage-tinified-1024x784.png\" alt=\"\" class=\"wp-image-220\" srcset=\"https:\/\/text.email\/blog\/wp-content\/uploads\/2026\/04\/smsformatting-onsettingspage-tinified-1024x784.png 1024w, https:\/\/text.email\/blog\/wp-content\/uploads\/2026\/04\/smsformatting-onsettingspage-tinified-300x230.png 300w, https:\/\/text.email\/blog\/wp-content\/uploads\/2026\/04\/smsformatting-onsettingspage-tinified-768x588.png 768w, https:\/\/text.email\/blog\/wp-content\/uploads\/2026\/04\/smsformatting-onsettingspage-tinified-1536x1176.png 1536w, https:\/\/text.email\/blog\/wp-content\/uploads\/2026\/04\/smsformatting-onsettingspage-tinified-2048x1568.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>If you leave this box empty, you&#8217;ll just get the default <code>{subject}: {body}<\/code> formatting for your messages. <\/p>\n\n\n\n<p>But when you enter your own template, that takes over&#8230;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"variables\">Using the text.email variables<\/h3>\n\n\n\n<p>There are <strong>four main variables you can use in your template<\/strong>, and they&#8217;re the four most fundamental elements of an email. They are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>{subject}<\/code><\/li>\n\n\n\n<li><code>{body}<\/code><\/li>\n\n\n\n<li><code>{from}<\/code><\/li>\n\n\n\n<li><code>{to}<\/code><\/li>\n<\/ul>\n\n\n\n<p>So if you type: <code>Message from {from}: {subject}<\/code> and the incoming email is from <code>alerts@example.com<\/code> with subject <code>Server down<\/code> and body <code>The web server is not responding<\/code>, the text you&#8217;ll receive becomes:<\/p>\n\n\n\n<p><code>Message from alerts@example.com: Server down<\/code><\/p>\n\n\n\n<p>The redundant email body text gets dropped entirely because you didn&#8217;t include <code>{body}<\/code> in your template.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"a-few-quick-examples\">Some examples of the text.email SMS formatting variables in action<\/h3>\n\n\n\n<p>Basing all of this off the example (email from <code>alerts@example.com<\/code> to <code>2165559999@greenteamalerts.text.email<\/code> with subject <code>Server down<\/code> and body <code>The web server is not responding<\/code>)&#8230;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Subject only<\/h4>\n\n\n\n<p><strong>Formatting: <\/strong><code>{subject}<\/code><\/p>\n\n\n\n<p><strong>Text message:<\/strong> <code>Server down<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Prefix plus subject<\/h4>\n\n\n\n<p><strong>Formatting: <\/strong><code>ALERT: {subject}, {body}<\/code><\/p>\n\n\n\n<p><strong>Text message:<\/strong> <code>ALERT: Server down, The web server is not responding<\/code><\/p>\n\n\n\n<p><strong>Sender and subject<\/strong><\/p>\n\n\n\n<p><strong>Formatting: <\/strong><code>From {from} \u2014 {subject}<\/code><\/p>\n\n\n\n<p><strong>Text message:<\/strong> <code>From alerts@example.com \u2014 Server down<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Including the To<\/h4>\n\n\n\n<p><strong>Formatting: <\/strong><code>To {to} - {subject}<\/code><\/p>\n\n\n\n<p><strong>Text message:<\/strong> <code>To <code>2165559999@greenteamalerts.text.email<\/code> \u2014 Server down<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"literal-braces\"><strong>What if you need to include actual braces?<\/strong><\/h4>\n\n\n\n<p>Need an actual <code>{<\/code> or <code>}<\/code> in your message? Double them up: <code>{{<\/code> and <code>}}<\/code>.<\/p>\n\n\n\n<p><strong>Formatting: <\/strong><code>Raw value: {{subject}} Actual value: {subject}<\/code><\/p>\n\n\n\n<p><strong>Text message:<\/strong> <code>Raw value: {subject} Actual value: Server down<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"truncating\">Automatically truncating longer messages<\/h3>\n\n\n\n<p>Sometimes your system will send messages where the subject or body is too long for a clean text (or one that fits in a single message). And usually, you can get the picture of whether or not you need to dig in just from a small piece of the message.<\/p>\n\n\n\n<p>You can <strong>cap the length of any variable <\/strong>by adding <code>:N<\/code> after the variable name.<\/p>\n\n\n\n<p>For instance, <code>{subject:60}<\/code> gives you the first 60 characters of the subject. Anything beyond that gets cut off.<\/p>\n\n\n\n<p>Let&#8217;s say your system sends the email with the subject: <code>Server down in us-east-1 (code AWS-1231-12nas-342)<\/code> and the body: <code>Alert: Web server is not responding after multiple health checks failed<\/code> <code>Location: Easton, Virginia Time: 23:43:57:123 Failure code: 1231-12nas-342-base If you believe this is in error, head to https:\/\/aws-12.amazserver.net\/123123adasaasdas<\/code>. <\/p>\n\n\n\n<p><strong>Formatting:<\/strong> <code>{subject:25}: {body:95}...<\/code><\/p>\n\n\n\n<p><strong>Text message:<\/strong> <code>Server down in us-east-1: <code>Alert: Web server is not responding after multiple health checks ...<\/code><\/code><\/p>\n\n\n\n<p>Those are the basics of SMS formatting in text.email&#8230; now let&#8217;s cover the pro move.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"advanced\">How to Create an Advanced SMS Formatting Template with Regex<\/h2>\n\n\n\n<p>When you want templates that get a little more sophisticated plucking out pieces of your email to turn them into texts, <strong>you&#8217;ll need to use regex<\/strong>.<\/p>\n\n\n\n<p>Here, instead of grabbing an entire field like <code>{body}<\/code>, you can automatically dig <em>inside<\/em> the subject or body and pull out just the piece you care about.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"regex\">Regex formatting in text.email<\/h3>\n\n\n\n<p>The syntax looks like this: <code>{subject:\/pattern\/flags}<\/code> or <code>{body:\/pattern\/flags}<\/code>.<\/p>\n\n\n\n<p>Your regex pattern needs named capture group(s) like <code>?&lt;callback&gt;...<\/code> as it parses through the email, otherwise the first capture group is used. (And if there are no capture groups in the regex, the whole match is used.)<\/p>\n\n\n\n<p>The supported flags are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>i<\/code>&nbsp;(ignore case)<\/li>\n\n\n\n<li><code>s<\/code>&nbsp;(dot matches newline)<\/li>\n\n\n\n<li><code>m<\/code>&nbsp;(multiline)<\/li>\n\n\n\n<li><code>x<\/code>&nbsp;(ignore pattern whitespace).<\/li>\n<\/ul>\n\n\n\n<p>Multiple regex matches are joined with a <code>;<\/code> \u2014 and multple captured groups are joined with a <code>|<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Examples of regex formatting with text.email<\/h3>\n\n\n\n<p>Let&#8217;s say we got this email:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Subject: Unit A1NH-Emerg B1-Cafe down\nTime: 2026.03.25 06:49:28 - EDT\nCallback: 212-555-2394\nAccount Name: 8X8\nName: A1NH-Emerg B1-Cafe<\/code><\/pre>\n\n\n\n<p>You don&#8217;t need all of that in a text. You need the callback number. So your template is:<\/p>\n\n\n\n<p><strong>Formatting: <\/strong><code>Callback: {body:\/Callback:\\s*(?&lt;callback&gt;[0-9x+\\- ]+)\/i}<\/code><\/p>\n\n\n\n<p><strong>Text message:<\/strong> <code>Callback: 212-555-2394<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Extracting multiple fields with regex<\/h3>\n\n\n\n<p>Want the callback number <em>and<\/em> the account name? You can do that as well.<\/p>\n\n\n\n<p><strong>Formatting: <\/strong><code>Callback: {body:\/Callback:\\s*(?&lt;callback&gt;[0-9x+\\- ]+)\/i} \u2014 Account: {body:\/Account Name:\\s*(?&lt;account&gt;.+)\/i}<\/code><\/p>\n\n\n\n<p><strong>Text message:<\/strong> <code>Callback: 212-555-2394 \u2014 Account: 8X8<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"more-extraction-examples\">More regex extraction examples<\/h3>\n\n\n\n<p>These are all copy-paste-and-adapt starting points. (If you&#8217;ve never written a regex before, I highly recommend pasting all the info from this section into your LLM of choice, telling it what you want to extract from texts, and having it write the regex for you. Your ability to handcode regex patterns from scratch will not be on the test.)<\/p>\n\n\n\n<p><strong>Order number<\/strong> from an email containing <code>Order Number: 58422193<\/code>:<\/p>\n\n\n\n<p><strong>Formatting: <\/strong><code>Order {body:\/Order Number:\\s*(?&lt;order&gt;\\d+)\/i}<\/code><\/p>\n\n\n\n<p><strong>Text message:<\/strong> <code>Order 58422193<\/code><\/p>\n\n\n\n<p><strong>Tracking number<\/strong> from <code>Tracking: 1Z999AA10123456784<\/code>:<\/p>\n\n\n\n<p><strong>Formatting: <\/strong><code>Tracking {body:\/Tracking:\\s*(?&lt;tracking&gt;[A-Z0-9]+)\/i}<\/code><\/p>\n\n\n\n<p><strong>Text message:<\/strong> <code>Tracking 1Z999AA10123456784<\/code><\/p>\n\n\n\n<p><strong>Ticket ID<\/strong> from a subject like <code>Ticket #84721 has been escalated<\/code>:<\/p>\n\n\n\n<p><strong>Formatting: <\/strong><code>Ticket {subject:\/#(?&lt;id&gt;\\d+)\/}<\/code><\/p>\n\n\n\n<p><strong>Text message:<\/strong> <code>Ticket 84721<\/code><\/p>\n\n\n\n<p><strong>Temperature reading<\/strong> from <code>Sensor Temp: 84.2 F<\/code>:<\/p>\n\n\n\n<p><strong>Formatting: <\/strong><code>Temp {body:\/Sensor Temp:\\s*(?&lt;temp&gt;[0-9.]+\\s*[A-Z])\/i}<\/code><\/p>\n\n\n\n<p><strong>Text message:<\/strong> <code>Temp 84.2 F<\/code><\/p>\n\n\n\n<p><strong>IP address<\/strong> from <code>Source IP: 10.24.8.19<\/code>:<\/p>\n\n\n\n<p><strong>Formatting: <\/strong><code>IP {body:\/Source IP:\\s*(?&lt;ip&gt;\\d+\\.\\d+\\.\\d+\\.\\d+)\/i}<\/code><\/p>\n\n\n\n<p><strong>Text message:<\/strong> <code>IP 10.24.8.19<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"combining\">Combining all the formatting skills into a single template<\/h3>\n\n\n\n<p>Yes, you can combine the basic variables, truncation, and regex all into one template.<\/p>\n\n\n\n<p>For example&#8230;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Concise incident alert<\/h4>\n\n\n\n<p><strong>Formatting: <\/strong><code>INCIDENT \u2014 {subject:50} \u2014 Callback: {body:\/Callback:\\s*(?&lt;callback&gt;[0-9x+\\- ]+)\/i}<\/code><\/p>\n\n\n\n<p><strong>Text message:<\/strong> <code>INCIDENT \u2014 911 Call Alert \u2014 Callback: 342-983-2394<\/code><\/p>\n\n\n\n<p><strong>Sender plus extracted account<\/strong><\/p>\n\n\n\n<p><strong>Formatting: <\/strong><code>From {from} | Account: {body:\/Account Name:\\s*(?&lt;account&gt;.+)\/i}<\/code><\/p>\n\n\n\n<p><strong>Text message:<\/strong> <code>From dispatch@example.com | Account: 8X8<\/code><\/p>\n\n\n\n<p id=\"one-limitation\"><em>(One limitation note: You can&#8217;t combine truncation and regex inside the same token. So this won&#8217;t work:<\/em><code>{body:50:\/Callback:\\s*(?&lt;callback&gt;.+)\/}<\/code><em>. Use the regex to extract what you need since that already limits the output), or structure your template to handle length with separate tokens.)<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"getting-started\">Getting Started with SMS Formatting in text.email<\/h2>\n\n\n\n<p>If you&#8217;re new to this, start simple, like just sending <code>{subject}<\/code> or <code>{subject}: {body:80}<\/code>.<\/p>\n\n\n\n<p>Once you&#8217;ve got a feel for which emails are too noisy as texts, pick one and enlist AI to help you write a regex template for it.<\/p>\n\n\n\n<p>And if you aren&#8217;t using <a href=\"https:\/\/text.email\" data-type=\"link\" data-id=\"https:\/\/text.email\">text.email<\/a> yet \u2014 give it a try and see <em>just<\/em> how easy these alerts are to create and <em>just<\/em> how much peace of mind they give you. You can sign up for an account and <strong>even try out this SMS formatting as part of your 10-message free trial<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to create a formatting template in text.email for smarter email-to-text conversions.<\/p>\n","protected":false},"author":1,"featured_media":223,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,8],"tags":[],"class_list":["post-213","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-email-to-sms","category-text-email-tips"],"_links":{"self":[{"href":"https:\/\/text.email\/blog\/wp-json\/wp\/v2\/posts\/213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/text.email\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/text.email\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/text.email\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/text.email\/blog\/wp-json\/wp\/v2\/comments?post=213"}],"version-history":[{"count":7,"href":"https:\/\/text.email\/blog\/wp-json\/wp\/v2\/posts\/213\/revisions"}],"predecessor-version":[{"id":225,"href":"https:\/\/text.email\/blog\/wp-json\/wp\/v2\/posts\/213\/revisions\/225"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/text.email\/blog\/wp-json\/wp\/v2\/media\/223"}],"wp:attachment":[{"href":"https:\/\/text.email\/blog\/wp-json\/wp\/v2\/media?parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/text.email\/blog\/wp-json\/wp\/v2\/categories?post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/text.email\/blog\/wp-json\/wp\/v2\/tags?post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}