n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
48.77k stars 7.72k forks source link

Gmail node with HTML send option has false requirement #1326

Closed Adrian-Samuel closed 3 years ago

Adrian-Samuel commented 3 years ago

Hey!

So with the new version of n8n, you are able to send HTML via the Gmail Node. However the HTML is meant to be an option instead of the plain text option. You can't have both. However if you remove the contents of the "message" field in the UI/JSON then the flow won't save or work.

Whatever you put in the message field doesn't get sent, but the node won't let you execute it unless you fill it out. This is most clearly a bug.

An example flow can be found here:

{
  "name": "Test Email Flow",
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        520,
        300
      ]
    },
    {
      "parameters": {
        "resource": "message",
        "subject": "Testing",
        "includeHtml": true,
        "htmlMessage": "<!DOCTYPE html>\n<html>\n<body>\n  \n  <h1> Some Email Title </h1>\n  \n</body>\n</html>",
        "toList": [
          "your_email@gmail.com"
        ],
        "additionalFields": {}
      },
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 1,
      "position": [
        280,
        240
      ],
      "credentials": {
        "gmailOAuth2": "Some Credentials"
      }
    }
  ],
  "connections": {},
  "active": false,
  "settings": {
    "saveManualExecutions": true
  },
  "id": "2"
}

The ideal behaviour would simply be that the UI message field gets removed when the HTML option is selected

Screenshot 2021-01-10 at 17 45 55
janober commented 3 years ago

That is actually not correct. Both versions do get send: Screenshot from 2021-01-08 07-48-12

Will probably display one or the other depending on the device. So I guess if the device does not support HTML it will fall back to the text version. So both should be set. So would at a pure minimum write something like "HTML support is needed to display message".

Hope that makes sense.