Add the character and segment count when crafting a script.

Important to note that the script builder can only provide a count _before_ variables are substituted. Admins will need to take into account long contact names, custom fields like event addresses, etc.
Hmm, may need an additional step with a preview box which substitutes variables and presents the final count so the user can confirm. Some of this information, particularly event addresses, can be too long for the user to do the math in their heads.
re event addresses, this is a good reason to use a link shortener like bit.ly to point folks to an Event RSVP page with the event address etc - it's a shorter link, and you know in advance the character count. And folks can then RSVP at the event page, and add info you may not have - like e-mail,their ZIP/ address, etc.
I've been diving into Twilio message logs, and (re)discovered that shorter is sometimes better. If you are sending longer reply messages than necessary, you may be spending more $ than necessary. Longer replies (over 160 characters) are split into message 'segments' so you may be paying 2x or 3x for a reply that can be shorter and more direct - and more likely to be read :).
Here's some handy guidance from Twilio on message length . And here's a handy tool to use to test how many 'message segments' a reply will cost you.
Each 'message segment' for a Twilio SMS costs .75 cents - so a reply with two segments is 1.5 cents, with three is 2.25 cents, etc. Keeping replies less than 160 characters or 1 message segment could save your org a bunch of money, cumulatively, if you are texting in large volume. See here re limits and encoding: https://www.twilio.com/docs/glossary/what-sms-character-limit
Helpful info! Thanks, @joemcl! Wonder what the current average breakdown is between users who do get charged for lots of segments vs. those who see messages grouped (or get them all free under their plan).
Many organizations (e.g. MoveOn) have their own URL shorteners, so I think this issue is more about initial text messages where we want to include more detail.
(Why is it worth sending more info up front? It affects how contacts react to the message. Sometimes a more detailed "ask" in the first message results in more contacts taking action.)
@dinahsanders yeah and an initial ask/message can be succinct too :) .
Another important consideration here showing what encoding will be used. Using characters outside the GSM-7 character set results in using UCS-2 encoding which is limited to 70 characters.
For example, try using a bullet • in this debugger: http://chadselph.github.io/smssplit/ (this project would also be a good implementation reference)
Maybe the default can be it counts the characters of {firstName}, etc rather than omitting them and then we communicate that char count is 'estimated' -- also we should make it red/warning-colored when char count goes over SMS level (possibly with a message about MMS rates and deliverability)
@joemcl @DinahSanders @bchrobot @schuyler1d I'm cleaning up our good first issuess and am noticing that discussion ended here a while ago. Is this feature still wanted? If so, I think we should aim to be settled on a design before giving it to a first time contributor.
Do we like @schuyler1d 's proposal from Jun 4? Removing the good first issue label til we have consensus on design!
@ibrand yes definitely still desired. A note - now that we can create 'scripts' for a Campaign in Google Docs and import those, a character count for an initial message (and of course any part of a script) can be done in that Google doc. Not ideal, but a proxy/workaround. Ideally IMHO the character count will show for an Initial message, Interactions, Canned etc in the Campaign creation UI, whether using the UI directly to add initial, Interactions, Canned etc, or, after import of a script from a Google Doc. cc: @deasterdaywfp @lperson
This is ready to be worked on! Whoever works on this can reference this comment:
https://github.com/MoveOnOrg/Spoke/issues/843#issuecomment-498883602
For info on the consensus on how to deal with the fact that variables can only be counted before they are substituted.
It does still need a final UI decision, but sticking with something simple should work here. Comment with a mock if you want to before submitting a PR
@ibrand just to note that, since we can now create scripts in a Google Doc, and then import them into Spoke, and Google Docs has word and character counting built-in, perhaps a clever dev like @lperson :) can figure out if a Google Docs script template for Spoke can be created which will show character counts in the Google Docs UI automatically on creation of the first Interaction/initial message, and the estimated number of 'message segments' that will be used for that initial message.
And/or maybe Spoke can be connected to the Google Docs API to show character counts and message segments for an Initial message, if created using the Spoke Campaign UI rather than importing a script from a Google Doc.
This was completed by https://github.com/MoveOnOrg/Spoke/pull/1679