I have tried to invoke plist msg to get names for attachments to save to pdf:
(insert (concat "<strong>Attachments</strong>: "
(mu4e-message field msg :attachment) "</p>"))
This does not work either. I am not looking to have urls asscoated with the save to pdf. have attachment names will suffice.
The relevant code from mu4e-actions.el is:
(defun mu4e~write-body-to-html (msg)
"Write MSG's body (either html or text) to a temporary file; return the filename."
(let* ((html (mu4e-message-field msg :body-html))
(txt (mu4e-message-field msg :body-txt))
(tmpfile (mu4e-make-temp-file "html"))
(attachments (cl-remove-if (lambda (part)
(or (null (plist-get part :attachment))
(null (plist-get part :cid))))
(mu4e-message-field msg :parts))))
(unless (or html txt)
(mu4e-error "No body part for this message"))
(with-temp-buffer
(insert "<head><meta charset=\"UTF-8\"></head>\n")
(insert (concat "<p><strong>From</strong>: "
(mu4e~action-header-to-html msg :from) "</br>"))
(insert (concat "<strong>To</strong>: "
(mu4e~action-header-to-html msg :to) "</br>"))
(insert (concat "<strong>Cc</strong>: "
(mu4e~action-header-to-html msg :cc) "</br>"))
(insert (concat "<strong>Date</strong>: "
(format-time-string mu4e-view-date-format (mu4e-message-field msg :date)) "</br>"))
(insert (concat "<strong>Subject</strong>: "
(mu4e-message-field msg :subject) "</p>"))
(insert (concat "<strong>Attachments</strong>: "
(mu4e-message-field msg :attachment) "</p>"))
(insert (or html (concat "<pre>" txt "</pre>")))
(write-file tmpfile)
;; rewrite attachment urls
(mapc (lambda (attachment)
(goto-char (point-min))
(while (re-search-forward (format "src=\"cid:%s\""
(plist-get attachment :cid)) nil t)
(if (plist-get attachment :temp)
(replace-match (format "src=\"%s\""
(plist-get attachment :temp)))
(replace-match (format "src=\"%s%s\"" temporary-file-directory
(plist-get attachment :name)))
(let ((tmp-attachment-name
(format "%s%s" temporary-file-directory
(plist-get attachment :name))))
(mu4e~proc-extract 'save (mu4e-message-field msg :docid)
(plist-get attachment :index)
mu4e-decryption-policy tmp-attachment-name)
(mu4e-remove-file-later tmp-attachment-name)))))
attachments)
(save-buffer)
tmpfile)))
Any suggestions on how to get attachment names to save with the pdf?