Skip to content

Latest commit

 

History

History
89 lines (68 loc) · 3.79 KB

File metadata and controls

89 lines (68 loc) · 3.79 KB
title Message Templates
nav_order 13
description API reference for the Makeplans message templates endpoint — the content of booking confirmations, reminders and follow-ups.

Message templates define the content of messages sent to customers for booking events such as confirmation, reminder, and follow-up.

Attributes

NameTypeDescription
idIntegerAutomatically set
created_atDatetimeAutomatically set
updated_atDatetimeAutomatically set
message_typeStringRequired. Values: confirmation, reminder, follow_up. See message types.
delivery_typeStringRequired. Values: email, sms.
subjectStringMessage subject line. Required for email, not applicable for sms.
templateLiquid-TextRequired. Message body template.
delivery_timingStringWhen the message should be delivered. Required except for confirmation. See delivery timing.
activeBooleanWhether the template is active.
servicesArrayService IDs this template applies to.
settingsObjectNot required. Key/value. Stored as strings.
custom_dataObjectNot required. Key/value. Stored as strings.

Message types

  • confirmation — sent when a booking is created.
  • reminder — sent before a booking starts.
  • follow_up — sent after a booking ends.

Delivery timing

The delivery_timing value is a natural language time expression parsed relative to a base time that depends on message_type:

message_typeBase timeExample delivery_timingResult
confirmationcreated_at (booking creation)in 5 minutes5 min after booking is created
reminderstarts_at (booking start)3 hours ago3 hours before booking starts
reminderstarts_at1 day ago1 day before booking starts
follow_upends_at (booking end)in 2 hours2 hours after booking ends
follow_upends_atin 1 day1 day after booking ends

The expression is parsed relative to the base time. So 3 hours ago relative to starts_at means 3 hours before the booking starts, and in 2 hours relative to ends_at means 2 hours after the booking ends.

Listing

GET /message_templates will return all message templates.

Response

[
  {
    "message_template": {
      "id": 1,
      "created_at": "2012-09-20T15:34:16+02:00",
      "updated_at": "2012-09-20T15:34:16+02:00",
      "message_type": "confirmation",
      "delivery_type": "email",
      "subject": "Your booking is confirmed",
      "template": "Hi {{ person.name }}, your booking is confirmed.",
      "delivery_timing": "in 5 minutes",
      "active": true,
      "services": [1, 2],
      "settings": null,
      "custom_data": null
    }
  }
]

Get message template

GET /message_templates/{message_template_id} will get a message template with id {message_template_id}.

Add new message template

POST /message_templates will create a new message template.

Update message template

PUT /message_templates/{message_template_id} will update existing message template with id {message_template_id}.

Delete message template

DELETE /message_templates/{message_template_id} will delete existing message template with id {message_template_id}.