MessageFragments

Duplicate a message fragment

Creates a copy of an existing MessageFragment, applying any overrides supplied in the request body. Useful when seeding similar email copy (e.g. per-offering variants of a shared template, or A/B test variants).

Requires the SETTINGS_MANAGE permission on the source fragment's site, plus the create ability on MessageFragment. The copy is created at the source fragment's site.

post/shop/message-fragments/{messageFragmentId}/copy

Request body

namestring required

Internal label for the new copy. Conventionally the source's name suffixed with "(Copy)" or a variant tag.

message_type'basket_cancelled' | 'basket_confirmed' | 'basket_follow_up' | 'basket_item_cancelled' | 'basket_reminder' | 'order_summary' | 'pay_by_link_request' | 'appointment_enquiry_confirmed' | 'visit_prompt' | 'membership_welcome' | 'membership_cancelled' | 'voucher_recipient' | 'membership_enquiry_confirmed' | 'new_order' | 'new_enquiry'

Override the message_type on the new copy. Defaults to the source's value.

messagestring nullable

Body of the fragment. Defaults to the source's value.

priorityinteger nullable

Render order within a message. Fragments are concatenated in ascending priority order.

permitted_membership_type_idsstring[] nullable

MembershipType IDs the new copy is restricted to.

Example request

{
  "name": "Spa - arrival instructions (Copy)",
  "message": "<p>Hi {{ customer.first_name }} - we're looking forward\nto seeing you soon.</p>\n",
  "priority": 10,
  "offerings": [
    {
      "offering_name": "Twilight massage",
      "offering_type": "appointment"
    }
  ]
}

Response

The message fragment was successfully retrieved.

Example response

{
  "data": {
    "id": "65d4a6f7f4c1b22a3c5d4e8a",
    "name": "Spa - arrival instructions",
    "message_type": "basket_confirmed",
    "message": "<p>Hi {{ customer.first_name }} - we're looking forward to\nseeing you on {{ booking.starts_at|date }}. Please arrive\n15 minutes early to check in at reception.</p>\n",
    "priority": 10,
    "offerings": [
      {
        "offering_name": "Twilight massage",
        "offering_type": "appointment"
      }
    ],
    "permitted_membership_type_ids": [
      "65a1c4f7f4c1b22a3c5d1234"
    ]
  }
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.