Hello,
my $employer adds a rather annoying and unnecessary banner to any incoming email. I would like to strip away that banner when I open a message for reading. I found some inspiration on modifying messages from a
previous discussion in the mailing list, but was unable to modify it successfully.
Stripping down the function, If I attempt [0] interactively, body-string will contain the email body contents. If I attempt while hooking into mu4e-view-mode-hook [1], then body-string is empty.
Separately, I found [2] will return the subject of an open email successfully, but when attempting the same with :body or :text, nil is returned.
What's the idiomatic way of programmatically retrieving the body contents when I have opened up an email in a buffer?
[0]:
(defun my/mail-banner-strip ()
"Strip banner from emails"
(interactive)
(message-goto-body)
(let* ((body-string (buffer-string)))
(message "Contents body-string: %s" body-string)))
[1]:
(add-hook 'mu4e-view-mode-hook 'my/mail-banner-strip)
[2]:
(mu4e-message-field (mu4e-message-at-point) :subject)