Hello,
I need some help setting up an action.
The action should compose a reply to the message, insert a provided
text, send it and mark the message for deletion.
This is the what I have come up so far.
#+BEGIN_SRC emacs-lisp
(defun +mu4e-reply-to-bill-action (msg)
"Quickly and without fuzz answer spam."
(let* (
(id (mu4e-message-field msg :message-id))
(subject (mu4e-message-field msg :subject))
(to (mu4e-message-field msg :from)) ;; switch as we are replying
(from (mu4e-message-field msg :to)))
;; prepare headers
;; (let headers '((FROM . from) (in-reply-to . id))) ;; not correct
;; compose acutal mail
(mu4e~compose-mail to subject headers) ;; I know I should not use
;; functions with mu4e~.
(mu4e-compose-goto-bottom)
(+reply-to-bill) ;; insert text at bottom
(message-send-and-exit)
;; In any case, mark it as deleted
(when (eq major-mode 'mu4e-headers-mode)
(mu4e-mark-set 'delete msg)
(mu4e-headers-next)))
(defun +reply-to-bill ()
"Send spammers to purgatory. Greedily borrowed from
https://twitter.com/Boris/status/1360208504544444417"
(interactive)
(insert "Please forward this email to
bi...@noprocurement.com,
and delete my email, as I’ll be changing jobs soon, and this
email address will no longer be active.
Bill Whiskoney is a senior partner at Nordic Procurement
Services, and he handles our budget and will help you further or
introduce you to someone who can."))
#+END_SRC
This obviously does not work yet.
If any you have any insight on this, any help is much appreciated.
--
cheers
Felix Schlepper