This PowerShell script enables a user with the appropriate permissions to send an SMS message to a bulk number of users. This can be useful, e.g in case the Ramsbottom CC session has to be cancelled at very late notice.
The script provides a fallback solution, because a PowerApps app is now available. The app written after this script was developed: see How to use the SMS to Speakeasy Contacts App.
Where to Find It
Name of script: SendSMSMessageUsingClickSend.ps1
The script is under source control and can be accessed from the following repository:
See the following article which provides an overview, including how to make changes to scripts using git:
How It Works
Launch the script – or open it in using PowerShell ISE or via Visual Studio Code and then running it. The script connects to a product called ClickSend, which provides a product that handles bulk sending of SMS messages. Using the ClickSend connection, it retrieves a list of SMS contact lists. These contact lists are automatically populated using a scheduled PowerShell runbook script – see:
Contact lists include SpeakeasyTrustees, SpeakeasyVolunteers, SpeakeasyCarers and SpeakeasyMembers (which are actually PWAs).
The user selects one or more groups to send to. Once all groups have been selected, a test message is sent to a special group called “SpeakeasySMSTest”. Any user who uses the script should try to include their mobile number in this group.
The user can then check that the SMS message is received on their phone, and attempt to send a reply back. The script is configured so that all replies are automatically routed back to the SMSReplies shared mailbox in Outlook.
If the SMS is received correctly and the reply is also received, then the user confirms this and the script then attempts to send the same SMS message to all the selected SMS contact lists. Each SMS message sent incurs a small cost (~3.5 pence), but bear in mind that some of the contact lists can contain 100 numbers, so sending one message can cost ~ £4. See the following document for details on how to configure automatic top-up for ClickSend, by registering a credit/debit card which will be debited when the account balance falls below a given threshold value.
The screenshot below shows an example execution of the script:
If the test user sent a reply to the email, as stated in the instructions in the screenshot above, then the reply should be received in the SMSReplies shared mailbox in Outlook. The reply email for the script execution shown in the screenshot above is given below:
Other Related Information
A description of shared mailboxes can be found here – see Accessing Shared Mailboxes from Outlook 365. Details on viewing the contents (via Outlook) of a shared mailbox that you have access to can be found here: Accessing Shared Mailboxes from Outlook 365
Useful ClickSend links
The contacts of each SMS contact list can be viewed via the ClickSend web site . First, login to the Clicksend dashboard: ClickSend Login. Login details are stored in BitWarden under the “ClickSend SMS Dashboard” entry.
The contact lists can be found here: ClickSend Contact Lists
ClickSend Activity history, e.g. sent and received messages, can be viewed here: ClickSend Activity History.
This can be useful when trying to identify problems. This link is particularly useful for identifying mobile numbers which are no longer valid. Make a note of the number and contact an administrator for them to try to identify who the number belongs to. This can be done by opening the appropriate Sharepoint list (this could be the membership list or the staff/volunteer list) and filtering the list contents by telephone number). It is best to remove that number from the database as the person has probably changed number but not told us.