Orders and invoices template

A template to enable a town hall to manage firewood orders from its residents.

It can be paired with n8n workflows to automate some tasks ; and could be applied to other ordering/invoicing use cases.

It is composed of:

1/ An order form (replaces the paper form dropped in mailboxes). The sending is done with @Amandine_Dugrain bulk mailing widget, to send the form to all residents at once

NB: If you send emails to large number of people, you would prefer using a mass mailing tool to avoid being classified as spam.
NB2 : you could use an automation tool + an action button to send the mails

2/ A “order confirmation” email page, with a table where you define the email that will be automatically sent each time the form is submitted. Automation is performed using the n8n tool.

You can define the sender, subject, and content of the email.

3/ Order management page to view the orders received through the form.

4/ Invoice management page, based on orders data

5/ Personalized PDF invoice generation page, using the markdown widget to generate Custom PDFs + an action button coupled with a n8n automation to send each invoice individually

6/ Payment tracking

4 Likes

And the n8n workflows that are associated to the template :slight_smile:
(to be saved in .json, then import directly in n8n)

order confirmation (static mail, Grist + Brevo)
{
  "name": "D&T - Template Affouage - confirmation de commande",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "588a2757-1557-4f1b-b31d-ea185ed03cb6",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -256,
        -16
      ],
      "id": "cb985d97-22ae-4f00-9cac-6b1d3494ed62",
      "name": "Webhook",
      "webhookId": "588a2757-1557-4f1b-b31d-ea185ed03cb6"
    },
    {
      "parameters": {
        "docId": "fgsUvXYaVqqL",
        "tableId": "Mail_automatique_confirmation_commande",
        "additionalOptions": {}
      },
      "type": "n8n-nodes-base.grist",
      "typeVersion": 1,
      "position": [
        -48,
        -16
      ],
      "id": "37e408a2-5096-4835-9d84-0dee4b4898d2",
      "name": "Grist",
      "credentials": {
        "gristApi": {
          "id": “DDDD”,
          "name": "Grist tuto/templates"
        }
      }
    },
    {
      "parameters": {
        "content": "\nRécupère le contenu du mail",
        "height": 360,
        "width": 200
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -80,
        -144
      ],
      "id": "42ef90bf-62c1-41fd-836f-a625239cd5ac",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "\nReçoit les infos du nouveau formulaire soumis\n",
        "height": 360,
        "width": 220
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -320,
        -144
      ],
      "id": "0f8ab11d-6646-4386-9bdd-f82ba4c268d4",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "subject": "={{ $json.Objet }}",
        "textContent": "={{ $json.Corps }}",
        "sender": "={{ $json.Expediteur }}",
        "receipients": "={{ $('Webhook').item.json.body[0].Mail }}",
        "additionalFields": {},
        "requestOptions": {}
      },
      "type": "n8n-nodes-base.sendInBlue",
      "typeVersion": 1,
      "position": [
        192,
        -16
      ],
      "id": "0607b917-2ebf-40e9-b2ab-f921f1e7fabb",
      "name": "Brevo",
      "credentials": {
        "sendInBlueApi": {
          "id": “DDDDD”,
          "name": "Brevo incubateur des territoires"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Grist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Grist": {
      "main": [
        [
          {
            "node": "Brevo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "4c5e0076-742c-4cd4-b6e0-88c94f611904",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "64b538dadf8cb304bf93401f92316a2a374b37d2138ad80b277949ff52fd80c4"
  },
  "id": "FpHwQUv5RuD8D59h",
  "tags": [
    {
      "createdAt": "2025-07-29T16:24:23.584Z",
      "updatedAt": "2025-07-29T16:24:23.584Z",
      "id": "uONy0rWvWOS7uhV3",
      "name": "D&T"
    },
    {
      "createdAt": "2025-07-29T16:10:35.114Z",
      "updatedAt": "2025-07-29T16:25:35.201Z",
      "id": "1WMRMzOcHPVQce1C",
      "name": "Mailing"
    }
  ]
}
sending invoices (dynamic mail, grist + Brevo)
{
  "name": "D&T -Template Affouage - factures",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "600d7616-d630-4b96-b2a5-f39f4cb18ab3",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -176,
        0
      ],
      "id": "20b45ed3-7ac6-4331-a60a-bf8dc8c38f75",
      "name": "Webhook",
      "webhookId": "600d7616-d630-4b96-b2a5-f39f4cb18ab3"
    },
    {
      "parameters": {
        "sendHTML": true,
        "subject": "={{$('Grist get static mail').first().json.Objet}}",
        "htmlContent": "={{$('Grist get static mail').first().json.Contenu + \"\\n\\n\\n\" + $json.PDF_Formula }} ",
        "sender": "={{$('Grist get static mail').first().json.Expediteur}}",
        "receipients": "={{ $json.Mail }}",
        "additionalFields": {},
        "requestOptions": {}
      },
      "type": "n8n-nodes-base.sendInBlue",
      "typeVersion": 1,
      "position": [
        480,
        0
      ],
      "id": "95c573f4-3c89-4e05-9d7e-460cb0b0f7a4",
      "name": "Brevo",
      "alwaysOutputData": true,
      "credentials": {
        "sendInBlueApi": {
          "id": “XXXX”,
          "name": "Brevo incubateur des territoires"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "operation": "update",
        "docId": "fgsUvXYaVqqLrHyZMQdQJk",
        "tableId": "Envoi_factures_n8n",
        "rowId": "1",
        "fieldsToSend": {
          "properties": [
            {
              "fieldId": "Statut",
              "fieldValue": "=❌ {{ $json.messageId }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.grist",
      "typeVersion": 1,
      "position": [
        720,
        48
      ],
      "id": "a16c62d5-7f68-4eca-9998-f7594a855ad2",
      "name": "Grist statut erreur",
      "executeOnce": true,
      "credentials": {
        "gristApi": {
          "id": “XXXXXX”,
          "name": "Grist tuto/templates"
        }
      }
    },
    {
      "parameters": {
        "docId": "prWr8VxGGgRj",
        "tableId": "Texte_pour_mail_facturation",
        "limit": "={{ 50 }}",
        "additionalOptions": {}
      },
      "type": "n8n-nodes-base.grist",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "a3245cbb-d3f3-4e58-abc7-c450b5d9b2e6",
      "name": "Grist get static mail",
      "credentials": {
        "gristApi": {
          "id": “DDDDD”,
          "name": "Grist tuto/templates"
        }
      }
    },
    {
      "parameters": {
        "docId": "prWr8VxGGgRj",
        "tableId": "Billing_and_Payment",
        "additionalOptions": {}
      },
      "type": "n8n-nodes-base.grist",
      "typeVersion": 1,
      "position": [
        208,
        0
      ],
      "id": "bbb0c7da-555f-4272-9622-1f1451361246",
      "name": "Grist get invoices",
      "credentials": {
        "gristApi": {
          "id": “DDDDD”,
          "name": "Grist tuto/templates"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Grist get static mail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Brevo": {
      "main": [
        [],
        [
          {
            "node": "Grist statut erreur",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Grist get static mail": {
      "main": [
        [
          {
            "node": "Grist get invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Grist get invoices": {
      "main": [
        [
          {
            "node": "Brevo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "57e08efe-0b37-4bed-b0ed-f4d319ee54c8",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "64b538dadf8cb304bf93401f92316a2a374b37d2138ad80b277949ff52fd80c4"
  },
  "id": "O79fvsICKl2lQsob",
  "tags": [
    {
      "createdAt": "2025-07-29T16:24:23.584Z",
      "updatedAt": "2025-07-29T16:24:23.584Z",
      "id": "uONy0rWvWOS7uhV3",
      "name": "D&T"
    },
    {
      "createdAt": "2025-07-29T16:10:35.114Z",
      "updatedAt": "2025-07-29T16:25:35.201Z",
      "id": "1WMRMzOcHPVQce1C",
      "name": "Mailing"
    }
  ]
}

For step by step explanation:

1 Like