Background:
I read my email through mu4e in (Doom) emacs. I set up an org-capture template that stores a TODO with a link to the current email I'm viewing, all working great.
Typically I do this from the inbox email folder, and I like to keep that clean, so I refile emails to my "All email" folder when I'm done with it.
If I refile after I added the org-todo, then the contained link no longer works (points to where the email used to be).
I'd like to keep my email inbox empty when I already track the todo elsewhere.
My question:
Is there a way to refile a message in mu4e, and at the same time add an org-todo with a valid link to the email?
I imagine I could write a custom elisp function to do it, but I'm not too comfortable with elisp in particular. I don't expect a copy-paste complete solution, but any help or pointers would be much appreciated!
Config:
I'm using Doom emacs with very little additional config, with
(doom!
;; ...
;; lots of unrelated modules
;; ...
:email
(mu4e +gmail))
The capture template I have looks as follows:
(setq org-capture-templates
'(("m" "Mail" entry (file+headline "~/org/gtd.org" "Tasks")
"* TODO Mail: (%:fromname) %:subject\nSCHEDULED:%t\n:PROPERTIES:\n:CREATED: %U\n:END:\n %a" :immediate-finish t :prepend t))