# Email Template Logs an email as an activity note, with attachment support. Save the code below as `Email.md` in your vault's `Templates/` folder. ````md <%* const desc = await tp.system.prompt("Brief description"); if (!desc) { return; } const today = tp.date.now("YYYY-MM-DD"); await tp.file.move(`Activities/Emails/${today} Email - ${desc}`); _%> --- type: email date: <% tp.date.now("YYYY-MM-DD") %> time: "<% tp.date.now('HH:mm') %>" direction: people: projects: classes: assignments: attachments: sources: subject: source_link: --- ## Summary ## Full content / notes ## Attachments <!-- Embed saved attachments, e.g. ![[Activities/Emails/Attachments/2026/June/file.pdf]] --> ## Source <!-- Paste the Apple Mail link below as: [Open in Apple Mail](message://<message-id>) --> ## Actions ```dataviewjs const btn = dv.el("button", "+ New task from this note"); btn.addEventListener("click", async () => { window._pendingTaskSource = dv.current().file.name; const templater = app.plugins.plugins["templater-obsidian"]; if (!templater) { new Notice("Templater plugin not enabled"); return; } const taskTpl = app.vault.getAbstractFileByPath("Templates/Task.md"); if (!taskTpl) { new Notice("Templates/Task.md not found"); return; } await templater.templater.create_new_note_from_template(taskTpl, "", "", true); }); ``` ## Spawned activities ```dataview TABLE WITHOUT ID ("[[" + file.name + "]]") AS "Note", type AS "Type", date AS "Date", default(status, default(subject, default(topic, ""))) AS "Detail" FROM "Activities" WHERE contains(sources, this.file.link) SORT date DESC ``` ````