{
  "schema_version": "1.0.0",
  "id": "out-of-office-reply-log",
  "title": "Log out-of-office replies with the return date",
  "category": "email",
  "difficulty": "beginner",
  "featured": false,
  "description": "Catch auto-replies to your outreach, record when each person is back and who covers for them, and file the email out of the inbox.",
  "tags": [
    "email",
    "gmail",
    "out-of-office",
    "outreach",
    "google-sheets"
  ],
  "apps": [
    "Gmail",
    "AI by Zapier",
    "Google Sheets"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 3 steps after the trigger",
      "AI by Zapier"
    ]
  },
  "tasks": {
    "typical": 3,
    "max": 3
  },
  "trigger": {
    "app": "Gmail",
    "event": "New Email Matching Search",
    "kind": "polling",
    "title": "New auto-reply",
    "why": "Gmail search catches the common auto-reply subjects in every language your prospects use; add your own phrases.",
    "config": {
      "Search String": "subject:(\"out of office\" OR \"automatic reply\" OR \"autoreply\" OR \"away from\") newer_than:2d"
    },
    "outputs": [
      "message_id",
      "thread_id",
      "from_email",
      "from_name",
      "to",
      "subject",
      "date",
      "body_plain",
      "snippet",
      "labels",
      "attachment_count",
      "attachment_names"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "read",
      "kind": "ai",
      "app": "AI by Zapier",
      "event": "Analyze and Return Data",
      "title": "Read the auto-reply",
      "why": "Pulls the return date, the alternate contact, and whether the person has left the company.",
      "fields": {
        "Model": "Default (fast)",
        "Instructions": "This is an automatic out-of-office reply. Return back_date (YYYY-MM-DD, empty if not stated), alternate_name and alternate_email (the person to contact instead, empty if none), left_company (yes if the reply says they no longer work there, otherwise no). Do not guess an email address that is not written in the text.",
        "Input data": "From: {{trigger.from_name}} <{{trigger.from_email}}>\nSubject: {{trigger.subject}}\n\n{{trigger.body_plain}}",
        "Output fields": "back_date, alternate_name, alternate_email, left_company"
      },
      "outputs": [
        "back_date",
        "alternate_name",
        "alternate_email",
        "left_company"
      ]
    },
    {
      "key": "log",
      "kind": "action",
      "app": "Google Sheets",
      "event": "Create Spreadsheet Row",
      "title": "Add it to the follow-up sheet",
      "why": "The sheet becomes the list of who to email again, when, and through whom.",
      "fields": {
        "Drive": "My Google Drive",
        "Spreadsheet": "Outreach",
        "Worksheet": "Auto-replies",
        "Columns": {
          "received_at": "{{trigger.date}}",
          "contact_email": "{{trigger.from_email}}",
          "contact_name": "{{trigger.from_name}}",
          "back_date": "{{read.back_date}}",
          "alternate_name": "{{read.alternate_name}}",
          "alternate_email": "{{read.alternate_email}}",
          "left_company": "{{read.left_company}}"
        }
      },
      "outputs": [
        "id",
        "row_number"
      ]
    },
    {
      "key": "file",
      "kind": "action",
      "app": "Gmail",
      "event": "Add Label to Email",
      "title": "File the auto-reply",
      "why": "Labels the email so it can be archived by a Gmail filter and stays out of the reply count.",
      "fields": {
        "Message": "{{trigger.message_id}}",
        "Labels": "Outreach/Auto-replies"
      },
      "outputs": [
        "id"
      ]
    }
  ]
}
