Org-mode is a popular and powerful way to deal with todo-lists, agendas inside
Emacs. It’s only natural to integrate it with mu4e, and
It can be useful to include links to e-mail messages or search queries in your
org-mode files. mu4e supports this by default, unless you set
mu4e-support-org to nil.
You can use the normal org-mode mechanisms to store links: M-x
org-store-link stores a link to a particular message when you are in
The message view. When you are in The headers view, M-x org-store-link
links to the query if mu4e-org-link-query-in-headers-mode is
non-nil, and to the particular message otherwise (which is the default).
You can customize the link description using mu4e-org-link-desc-func.
You can insert this link later with M-x org-insert-link. From
org-mode, you can go to the query or message the link points to with either
M-x org-agenda-open-link in agenda buffers, or M-x org-open-at-point
elsewhere — both typically bound to C-c C-o.
You can also directly capture such links — for example, to add e-mail
messages to your todo-list. For that, mu4e-org has a function
mu4e-org-store-and-capture. This captures the message-at-point (or header
— see the discussion on mu4e-org-link-query-in-headers-mode above),
then calls org-mode’s capture functionality.
You can add some specific capture-template for this. In your capture templates, the following mu4e-specific values are available:
item | description -----------------------------------------------------+------------------------ %:date, %:date-timestamp, %:date-timestamp-inactive | date, org timestamps %:from, %:fromname, %:fromaddress | sender, name/address %:to, %:toname, %:toaddress | recipient, name/address %:maildir | maildir for the message %:message-id | message-id %:path | file system path %:subject | message subject |
For example, to add a message to your todo-list, and set a deadline
for processing it within two days, you could add this to
org-capture-templates:
("P" "process-soon" entry (file+headline "todo.org" "Todo")
"* TODO %:fromname: %a %?\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\"))")
If you use the functionality a lot, you may want to define key-bindings for that in headers and view mode:
(define-key mu4e-headers-mode-map (kbd "C-c c") 'mu4e-org-store-and-capture) (define-key mu4e-view-mode-map (kbd "C-c c") 'mu4e-org-store-and-capture)
To build on the above, it can be useful to automatically track outgoing e-mail so you can follow-up later.
One way to do this is to first add a template to org-capture-templates:
("wm" "To-do" entry (file+headline "~/Org/todo.org" "Waiting for")
"* WAIT [[mu4e:msgid:%(eval sent-message-id)][%(eval sent-subject)]]\n\t%u"
:immediate-finish t)
Then invoke this template from sent-hook:
(defun my-org-wait-for-sent-mail ()
"Capture the outgoing mail."
(interactive)
(let* ((sent-message-id
(replace-regexp-in-string
"[<>]" "" (message-fetch-field "Message-Id")))
(sent-subject (or (message-fetch-field "Subject") "No subject")))
(org-capture nil "wm")))
(add-hook 'sent-hook #'my-org-wait-for-sent-mail)
All of the above likely needs tweaking for your particular setup, but should hopefully give some inspiration.