
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
n8n-nodes-document-generator
Advanced tools
This node creates dynamic content for documents or emails with Handlebars templates
This is an n8n community node. It helps you to create:
If you have any questions or remarks please contact me.
n8n is a fair-code licensed workflow automation platform.
Don't want to read? Import the sample workflow Generate dynamic contents for EMAILS or HTML pages to test this node with random samples.
Follow the installation guide in the n8n community nodes documentation.
This node was developed and tested with version 0.193.5 of n8n.
If you install this node, n8n will install automatically the next extra npm packages:
The node can solve multiple use cases when creating content like:
The sky is your limit!
Just follow the next samples to create your dynamic content and forget to use SET, FUNCTION, or FUNCTION ITEM nodes.
Supposing that you have a customer list in JSON:
[
{
"email": "miquel@n8nhackers.com",
"name": "Miquel",
"primary": true
},
{
"email": "contact@n8nhackers.com",
"name": "Contact",
"primary": false
}
]
We will try a Handlebars helper #if to show if the contact is the primary email or not.
If you use the next template:
<ul id="customer_list">
{{#each items}}
<li>{{name}}: {{email}} {{#if (eq primary true)}}(primary){{/if}}</li>
{{/each}}
</ul>
And you will get the next output to send by email in HTML format:
<ul id="customer_list">
<li>Miquel: miquel@n8nhackers.com (primary)</li>
<li>Contact: contact@n8nhackers.com</li>
</ul>
Property items is always mandatory to iterate over all items.
If you have one item/invoice with this JSON:
{
"date": "2022-01-12",
"to": "N8n hackers",
"address": "Granollers, Spain",
"total": 133.10,
"lines": [
{
"description": "Create a node to render items in handlebar templates",
"quantity": 1,
"amount": 100,
"vat": 21,
"total": 121
},
{
"description": "Test a node to render items in handlebar templates",
"quantity": 1,
"amount": 10,
"vat": 2.10,
"total": 12.1
}
]
}
You need to use this template:
Date: {{date}}
To: {{to}}
Address: {{address}}
Details:
{{#each lines}}
- "{{description}}" x {{quantity}} = {{amount}}€ + {{vat}}€ = {{total}}€
{{/each}}
Total invoice: {{total}}€
And you will get the next output to send by email in TEXT format:
Date: 2022-01-12
To: N8n hackers
Address: Granollers, Spain
Details:
- "Create a node to render items in handlebar templates" x 1 = 100€ + 21€ = 121€
- "Test a node to render items in handlebar templates" x 1 = 10€ + 2.10€ = 12.10€
Total invoice: 133.10€
I recommend using this method if you want to send multiple invoices.
Now the node supports helpers thanks to the @jaredwray/fumanchu package.
We recommend checking
Please, check the official page to review all the existing expressions in Handlebars.
N8N documentation on custom nodes
Clone the n8n-nodes-document-generator repository and execute:
# Use v20.12.2 = lts/iron
nvm use lts/iron
# Install dependencies
npm install
# Build the code
npm run build
# "Publish" the package locally
npm link
Create an N8N installation and add the n8n-nodes-document-generator to it:
# Ensure that custom nodes directory exists in your .n8n
mkdir ~/.n8n/custom
# Init npm packages (intro to all questions)
cd ~/.n8n/custom && npm init
# "Install" the locally published module
npm link n8n-nodes-document-generator
# Start n8n
n8n start
To make this node even better, please let us know, how you use it. Commits are always welcome.
If you have any issues, please let us know on GitHub.
Nodes by n8nhackers.com. For productive use and consulting on this, contact us please.
Special thanks to N8n nodemation workflow automation by Jan Oberhauser.
FAQs
This node creates dynamic content for documents or emails with Handlebars templates
The npm package n8n-nodes-document-generator receives a total of 3,982 weekly downloads. As such, n8n-nodes-document-generator popularity was classified as popular.
We found that n8n-nodes-document-generator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.