Created
June 9, 2021 17:39
-
-
Save sboli/b537c558eb31df4f245c3a0dfba703f2 to your computer and use it in GitHub Desktop.
Template to send a mail with gitlab release notes automatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Gitlab release notes", | |
"nodes": [ | |
{ | |
"parameters": {}, | |
"name": "Start", | |
"type": "n8n-nodes-base.start", | |
"typeVersion": 1, | |
"position": [ | |
440, | |
170 | |
] | |
}, | |
{ | |
"parameters": { | |
"httpMethod": "POST", | |
"path": "gitlab-release", | |
"options": {} | |
}, | |
"name": "Webhook", | |
"type": "n8n-nodes-base.webhook", | |
"typeVersion": 1, | |
"position": [ | |
630, | |
170 | |
], | |
"webhookId": "a29a048f-6622-4aac-9765-e1dc42f2b27c" | |
}, | |
{ | |
"parameters": { | |
"mode": "mergeByIndex" | |
}, | |
"name": "Merge", | |
"type": "n8n-nodes-base.merge", | |
"typeVersion": 1, | |
"position": [ | |
1040, | |
280 | |
] | |
}, | |
{ | |
"parameters": { | |
"functionCode": "return item[\"body\"]" | |
}, | |
"name": "getBody", | |
"type": "n8n-nodes-base.functionItem", | |
"typeVersion": 1, | |
"position": [ | |
840, | |
200 | |
] | |
}, | |
{ | |
"parameters": { | |
"authentication": "headerAuth", | |
"requestMethod": "POST", | |
"url": "https://gitlab.com/api/v4/markdown", | |
"options": {}, | |
"bodyParametersUi": { | |
"parameter": [ | |
{ | |
"name": "text", | |
"value": "={{$json[\"body\"][\"description\"]}}" | |
}, | |
{ | |
"name": "gfm", | |
"value": "true" | |
}, | |
{ | |
"name": "project", | |
"value": "your-project" | |
} | |
] | |
}, | |
"headerParametersUi": { | |
"parameter": [] | |
} | |
}, | |
"name": "convertMdToHtml", | |
"type": "n8n-nodes-base.httpRequest", | |
"typeVersion": 1, | |
"position": [ | |
840, | |
370 | |
], | |
"credentials": { | |
"httpHeaderAuth": "gitlab-api-key" | |
} | |
}, | |
{ | |
"parameters": { | |
"resource": "mail", | |
"fromEmail": "workflow@domain.tld", | |
"fromName": "Workflow Sender", | |
"toEmail": "you@domain.tld", | |
"subject": "Version {{$json[\"name\"]}}", | |
"contentType": "text/html", | |
"contentValue": "={{$json[\"html\"]}}", | |
"additionalFields": {} | |
}, | |
"name": "SendGrid", | |
"type": "n8n-nodes-base.sendGrid", | |
"typeVersion": 1, | |
"position": [ | |
1240, | |
280 | |
], | |
"credentials": { | |
"sendGridApi": "sendgrid-n8n" | |
} | |
} | |
], | |
"connections": { | |
"Merge": { | |
"main": [ | |
[ | |
{ | |
"node": "FunctionItem", | |
"type": "main", | |
"index": 0 | |
}, | |
{ | |
"node": "SendGrid", | |
"type": "main", | |
"index": 0 | |
} | |
] | |
] | |
}, | |
"getBody": { | |
"main": [ | |
[ | |
{ | |
"node": "Merge", | |
"type": "main", | |
"index": 0 | |
} | |
] | |
] | |
}, | |
"convertMdToHtml": { | |
"main": [ | |
[ | |
{ | |
"node": "Merge", | |
"type": "main", | |
"index": 1 | |
} | |
] | |
] | |
}, | |
"Webhook": { | |
"main": [ | |
[ | |
{ | |
"node": "getBody", | |
"type": "main", | |
"index": 0 | |
}, | |
{ | |
"node": "convertMdToHtml", | |
"type": "main", | |
"index": 0 | |
} | |
] | |
] | |
} | |
}, | |
"active": true, | |
"settings": { | |
"timezone": "America/La_Paz", | |
"saveExecutionProgress": "DEFAULT" | |
}, | |
"id": "1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment