Fwd: Compose reply action

7 views
Skip to first unread message

Felix Schlepper

unread,
Aug 10, 2022, 11:36:03 AM8/10/22
to mu-di...@googlegroups.com

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

Husain Alshehhi

unread,
Aug 10, 2022, 8:39:00 PM8/10/22
to mu-di...@googlegroups.com, Felix Schlepper

On Wed 10 Aug 2022 at 17:35, "Felix Schlepper" <f3sc...@outlook.com> wrote:

> This obviously does not work yet.
> If any you have any insight on this, any help is much appreciated.

Hi Felix. Which part does not work? Does this snippet send the email,
but not mark it? Or does it not send anything at all?



Reply all
Reply to author
Forward
0 new messages