{
  "id": "17yjHH5i669dVRGk",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "\u2757 Send Email Alert",
  "tags": [],
  "nodes": [
    {
      "id": "6daa4fcf-1fd5-440a-9fbf-545a2a1ccb46",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "subject"
            },
            {
              "name": "lines",
              "type": "array"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "f6b0969d-8043-4687-9a4d-68e109b7cacd",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        208,
        0
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "={{ $json.lines.join(\"\\n\") }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "=\u2757 n8n Alert: {{ $json.subject }}",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "57956b5a-0cad-4452-adf0-f34655d92561",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        -96
      ],
      "parameters": {
        "content": "\u26a0\ufe0f If you change the subject, you should change the email filter that selects these emails!"
      },
      "typeVersion": 1
    },
    {
      "id": "d534819e-84fd-45f3-9685-9396ad8bfed3",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -416
      ],
      "parameters": {
        "width": 464,
        "height": 384,
        "content": "This is a basic helper workflow to abstract the process of sending an alert email through Gmail.\n\nIt takes in two parameters:\n- Subject\n- Lines (as an array of lines)\n\nYou'll also need to fill in your email.\n\nNotably, all emails it sends have `\u2757 n8n Alert: ` prefixed to the subject line, which makes them easy to identify and highlight in an email inbox.\n\nIn Gmail, this can be done by starring all messages that come in with `\u2757 n8n Alert:` in the subject line, then using the Priority Inbox to push starreed messages to the top.\n\n_It's important to star the message rather than Mark As Important, because Gmail refuses to mark emails sent by automation as important._\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b5e01a9c-886e-432e-b894-7cd8421ba6ec",
  "connections": {
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}