{
  "schema_version": "1.0.0",
  "id": "calendly-reminder-day-ahead",
  "title": "Remind a Calendly invitee a day ahead",
  "category": "booking",
  "difficulty": "beginner",
  "featured": true,
  "description": "Each new Calendly booking schedules an email and a text exactly 24 hours before the meeting, with the reschedule link in both.",
  "tags": [
    "booking",
    "calendly",
    "reminders",
    "twilio",
    "gmail"
  ],
  "apps": [
    "Calendly",
    "Formatter by Zapier",
    "Delay by Zapier",
    "Gmail",
    "Filter by Zapier",
    "Twilio"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 5 steps after the trigger",
      "Filter by Zapier",
      "Formatter by Zapier"
    ]
  },
  "tasks": {
    "typical": 2,
    "max": 2
  },
  "trigger": {
    "app": "Calendly",
    "event": "Invitee Created",
    "kind": "instant",
    "title": "New booking",
    "why": "Fires the moment someone books any event type on your account.",
    "config": {
      "Scope": "User"
    },
    "outputs": [
      "invitee_name",
      "invitee_first_name",
      "invitee_email",
      "invitee_phone",
      "event_type_name",
      "event_start_time",
      "event_end_time",
      "timezone",
      "cancel_url",
      "reschedule_url",
      "questions_and_answers"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "remind_at",
      "kind": "formatter",
      "app": "Formatter by Zapier",
      "event": "Date / Time",
      "title": "Work out the reminder time",
      "why": "Subtracts 24 hours from the meeting start. Formatter steps do not use tasks.",
      "fields": {
        "Transform": "Add/Subtract Time",
        "Input": "{{trigger.event_start_time}}",
        "Expression": "-24 hours",
        "To Format": "YYYY-MM-DDTHH:mm:ssZ"
      },
      "outputs": [
        "output"
      ]
    },
    {
      "key": "wait",
      "kind": "delay",
      "app": "Delay by Zapier",
      "event": "Delay Until",
      "title": "Wait until a day before",
      "why": "Holds the run until the reminder time. Bookings made less than a day ahead stop here: they do not need a reminder.",
      "fields": {
        "Date/Time Delay Until": "{{remind_at.output}}",
        "How should we handle dates in the past?": "Always halt"
      },
      "outputs": [
        "run_at"
      ]
    },
    {
      "key": "email",
      "kind": "action",
      "app": "Gmail",
      "event": "Send Email",
      "title": "Email the reminder",
      "why": "Plain text from your own address, so it reads like a note from you rather than a system email.",
      "fields": {
        "To": "{{trigger.invitee_email}}",
        "Subject": "Tomorrow: {{trigger.event_type_name}}",
        "Body Type": "plain",
        "Body": "Hi {{trigger.invitee_first_name}},\n\nA quick reminder that we are meeting tomorrow ({{trigger.event_type_name}}). The invite in your calendar has the time in your time zone.\n\nIf the time no longer works, you can move it here: {{trigger.reschedule_url}}\n\nSee you then,\nYOUR_NAME",
        "From Name": "YOUR_BUSINESS_NAME"
      },
      "outputs": [
        "id",
        "thread_id"
      ]
    },
    {
      "key": "has_phone",
      "kind": "filter",
      "app": "Filter by Zapier",
      "event": "Only continue if...",
      "title": "Only invitees who gave a phone number",
      "why": "The phone question is optional on most booking forms; without a number the run ends after the email.",
      "conditions": [
        [
          {
            "field": "{{trigger.invitee_phone}}",
            "operator": "Exists"
          }
        ]
      ],
      "usually": true
    },
    {
      "key": "text",
      "kind": "action",
      "app": "Twilio",
      "event": "Send SMS",
      "title": "Text the reminder",
      "why": "One short text with the reschedule link. Calendly collects phone numbers with the country code, so no formatting step is needed.",
      "fields": {
        "From Number": "YOUR_TWILIO_NUMBER",
        "To Number": "{{trigger.invitee_phone}}",
        "Message": "Hi {{trigger.invitee_first_name}}, reminder: {{trigger.event_type_name}} with YOUR_BUSINESS_NAME tomorrow. Need to move it? {{trigger.reschedule_url}}",
        "Send Large Messages?": "No"
      },
      "outputs": [
        "sid",
        "status"
      ]
    }
  ]
}
