Skip to main content

Member Email and SMS

Weave can send your members email and text messages when something happens in your program: a welcome after they join, a note when they reach a tier, a reminder before points expire. You write the message once as a template, and an event rule sends it. Weave checks consent, handles unsubscribes and STOP replies, and records every message.

For example, a coffee chain emails "You've reached Gold, Sam" the moment a member reaches the Gold tier, and texts members a reminder two days before a free-drink coupon expires.

Member email and SMS are turned on per brand, with the Customer Messaging add-on. Ask your Loom Loyalty contact to turn them on. They also set up the sender: Loom Loyalty's own sender, or your own sending account and phone number.

Write a template​

A template holds the content for one kind of message. Create it with POST /message-templates:

curl -X POST https://api.loomloyalty.com/message-templates \
-H "Authorization: Bearer $LOOM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "tier-gold-welcome",
"channel": "EMAIL",
"subject": "You have reached Gold, {{customer.firstName}}",
"htmlBody": "<p>Welcome to Gold. You have {{customer.balance.points}} points to spend.</p>",
"textBody": "Welcome to Gold. You have {{customer.balance.points}} points to spend."
}'

Write variables as {{name}}:

VariableFilled with
customer.firstName, customer.lastNameThe member's name.
customer.balance.<currency code>The member's balance in that currency.
customer.tier.<program code>The member's tier in that program.
Any other nameA value the rule passes in templateData.

Every value is HTML-escaped. The currency or program a variable names must exist when you save. The code is unique in the environment and never changes.

Languages. The content is in defaultLocale (en unless you set it). Add variants for other languages, such as Spanish. A member gets the variant in their preferred language, or the default. A variant may only use the default's variables.

SMS. An SMS template sets "channel": "SMS" and an smsBody of up to 918 characters, with no subject or variants.

Manage templates with GET, PUT and DELETE /message-templates/{messageTemplateId}. Deleting a template frees its code, and a rule that still names it fails to send.

Send it from a rule​

Add a sendNotification action to an event rule:

{
"sendNotification": {
"kind": "NOTIFICATION",
"channelCode": "EMAIL",
"templateCode": "tier-gold-welcome",
"templateData": { "storeName": "Bean Street Coffee" }
}
}
FieldDescription
kindNOTIFICATION for a first message, or REMINDER for a follow-up.
channelCodeEMAIL or SMS.
templateCodeThe template to send.
templateDataValues for any variables the template uses beyond the member's own.

You can also ask the AI assistant to draft the rule for you.

Weave checks the member's consent for the channel when the message is sent, not when the rule runs.

  • Email. Every marketing email carries an unsubscribe link. A member who unsubscribes stops getting marketing email from your brand.
  • SMS. A member texts STOP (or UNSUBSCRIBE, CANCEL, END, QUIT, STOPALL) to opt out, START or UNSTOP to opt back in, and HELP or INFO to get your support reply. The whole text must be the keyword; case and trailing punctuation don't matter.
  • Quiet hours. Marketing texts go out between 8 AM and 9 PM in your brand's time zone. A text due outside those hours waits for the next morning.

See what was sent​

GET /customer-messages lists messages, and GET /customers/{customerId}/customer-messages lists one member's. Each message has a status:

StatusMeaning
QUEUEDRecorded and waiting to be sent.
SENDINGHanded off; the outcome isn't known yet.
SENTAccepted for delivery.
SUPPRESSEDDeliberately not sent. Not billed.
FAILEDCouldn't be sent. Not billed.

A suppressed or failed message has a statusReason, such as NO_CONSENT, NO_EMAIL, NO_PHONE, TEMPLATE_NOT_FOUND, TEMPLATE_VARIABLE_MISSING or CHANNEL_OFF. Accept reasons added later.