callumalpass_tasknotes/docs/examples/webhook-transforms/simple-template.json
Callum Alpass 7c26e9d3ca docs: add webhook transform examples and documentation
- Add comprehensive transform examples for Discord, Slack, Teams, and generic JSON
- Include ready-to-use JavaScript transforms with rich formatting
- Add JSON template examples showing variable substitution
- Create detailed README with usage instructions, debugging tips, and best practices
- Link transform examples from main webhooks documentation
- Support all webhook events including new recurring.instance.completed event

Examples include:
- discord-webhook.js: Rich embeds with colors and emojis
- slack-webhook.js: Slack-compatible attachments and formatting
- teams-webhook.json: Microsoft Teams MessageCard format
- simple-template.json: Basic JSON template for custom APIs
2025-08-13 12:46:08 +10:00

78 lines
No EOL
2.3 KiB
JSON

{
"task.created": {
"message": "📋 New task created: ${data.task.title}",
"priority": "${data.task.priority}",
"status": "${data.task.status}",
"due_date": "${data.task.due}",
"vault": "${vault.name}",
"timestamp": "${timestamp}",
"task_url": "obsidian://open?vault=${vault.name}&file=${data.task.path}"
},
"task.completed": {
"message": "✅ Task completed: ${data.task.title}",
"completion_time": "${timestamp}",
"vault": "${vault.name}",
"task_id": "${data.task.id}",
"priority": "${data.task.priority}"
},
"task.updated": {
"message": "✏️ Task updated: ${data.task.title}",
"current_status": "${data.task.status}",
"previous_status": "${data.previous.status}",
"vault": "${vault.name}",
"timestamp": "${timestamp}"
},
"time.started": {
"message": "⏰ Started working on: ${data.task.title}",
"task_title": "${data.task.title}",
"priority": "${data.task.priority}",
"status": "${data.task.status}",
"vault": "${vault.name}",
"start_time": "${timestamp}"
},
"time.stopped": {
"message": "⏹️ Stopped working on: ${data.task.title}",
"task_title": "${data.task.title}",
"vault": "${vault.name}",
"stop_time": "${timestamp}"
},
"pomodoro.completed": {
"message": "🍅 Pomodoro completed!",
"task_title": "${data.task.title}",
"completion_time": "${timestamp}",
"vault": "${vault.name}",
"celebration": "🎉 Great work!"
},
"recurring.instance.completed": {
"message": "🔄 Recurring task instance completed: ${data.task.title}",
"task_title": "${data.task.title}",
"instance_date": "${data.date}",
"recurrence_pattern": "${data.task.recurrence}",
"total_completed": "${data.task.complete_instances.length}",
"vault": "${vault.name}",
"timestamp": "${timestamp}"
},
"reminder.triggered": {
"message": "🔔 Reminder: ${data.message}",
"task_title": "${data.task.title}",
"due_date": "${data.task.due}",
"priority": "${data.task.priority}",
"reminder_time": "${timestamp}",
"vault": "${vault.name}"
},
"default": {
"message": "📢 TaskNotes event: ${event}",
"event_type": "${event}",
"vault": "${vault.name}",
"timestamp": "${timestamp}",
"raw_data": "${data}"
}
}