{
  "name": "FlowPantry - service-due-reminders",
  "flow": [
    {
      "id": 1,
      "module": "http:ActionSendData",
      "version": 3,
      "parameters": {},
      "mapper": {
        "url": "CUSTOMERS_URL",
        "method": "get",
        "headers": [],
        "qs": [],
        "serializeUrl": false,
        "parseResponse": true,
        "shareCookies": false,
        "rejectUnauthorized": true,
        "followRedirect": true,
        "useQuerystring": false,
        "gzip": true,
        "useMtls": false,
        "timeout": ""
      },
      "metadata": {
        "designer": {
          "x": 0,
          "y": 0
        }
      }
    },
    {
      "id": 2,
      "module": "builtin:BasicFeeder",
      "version": 1,
      "parameters": {},
      "mapper": {
        "array": "{{1.data}}"
      },
      "metadata": {
        "designer": {
          "x": 300,
          "y": 0
        }
      }
    },
    {
      "id": 3,
      "module": "http:ActionSendData",
      "version": 3,
      "parameters": {},
      "mapper": {
        "url": "https://api.twilio.com/2010-04-01/Accounts/YOUR_TWILIO_SID/Messages.json",
        "method": "post",
        "headers": [],
        "qs": [],
        "serializeUrl": false,
        "parseResponse": true,
        "shareCookies": false,
        "rejectUnauthorized": true,
        "followRedirect": true,
        "useQuerystring": false,
        "gzip": true,
        "useMtls": false,
        "timeout": "",
        "username": "YOUR_TWILIO_SID",
        "password": "YOUR_TWILIO_AUTH_TOKEN",
        "bodyType": "x_www_form_urlencoded",
        "data": "",
        "formFields": [
          {
            "key": "To",
            "value": "{{2.phone}}"
          },
          {
            "key": "From",
            "value": "YOUR_TWILIO_NUMBER"
          },
          {
            "key": "Body",
            "value": "Hi {{2.name}}, you're due for your next service with YOUR BUSINESS soon. Book a time: BOOKING_URL Reply STOP to opt out."
          }
        ]
      },
      "metadata": {
        "designer": {
          "x": 600,
          "y": 0
        }
      },
      "filter": {
        "name": "Due in the next 14 days, not yet reminded",
        "conditions": [
          [
            {
              "a": "{{2.last_service}}",
              "o": "date:less",
              "b": "next 14 days, and reminded_for ≠ due date"
            }
          ]
        ]
      }
    },
    {
      "id": 4,
      "module": "http:ActionSendData",
      "version": 3,
      "parameters": {},
      "mapper": {
        "url": "https://api.resend.com/emails",
        "method": "post",
        "headers": [
          {
            "name": "Authorization",
            "value": "Bearer YOUR_RESEND_API_KEY"
          }
        ],
        "qs": [],
        "serializeUrl": false,
        "parseResponse": true,
        "shareCookies": false,
        "rejectUnauthorized": true,
        "followRedirect": true,
        "useQuerystring": false,
        "gzip": true,
        "useMtls": false,
        "timeout": "",
        "bodyType": "raw",
        "contentType": "application/json",
        "inputMethod": "jsonString",
        "data": "{\"from\": \"YOUR_NAME <you@yourdomain.com>\", \"to\": \"{{2.email}}\", \"subject\": \"Time for your next service\", \"text\": \"Hi {{2.name}}, you're due soon. Book here: BOOKING_URL\"}"
      },
      "metadata": {
        "designer": {
          "x": 900,
          "y": 0
        }
      }
    }
  ],
  "metadata": {
    "instant": false,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": false,
      "slots": null,
      "confidential": false,
      "dataloss": false,
      "dlq": false,
      "freshVariables": false
    },
    "designer": {
      "orphans": []
    },
    "zone": "us1.make.com"
  }
}