How to export email from Emacs:
Define a function to export email:
(defun export-email ()
(interactive)
(message "Beginning Email Export")
(yank-visible-org-buffer)
(call-eml)
)
Decide on how to yank the text:
(defun yank-visible-org-buffer ()
(interactive)
(goto-char (point-min))
(mark-page)
;; (evil-yank (point-min) (point-max))
(org-copy-visible (point-min) (point-max))
)
Use seperate bash script to export the email:
(defun call-eml ()
(async-shell-command (format "~/bin/eml -o"))
)
Get a custom style sheet like this one and Write a bashscript to do some magic pandoc:
# Take the Clipboard
xclip -o -selection clipboard >> myemail
# Use Pandoc
pandoc -s --toc --self-contained --mathml $EmailFile -o myemail.html
# Embed a style sheet
# I do the style sheet like this because sometimes -C fails
echo "<style>" >> myemail.html
cat ~/Dropbox/profiles/Emacs/org-css/github-org.css >> myemail.html
echo "</style>" >> myemail.html
cat myemail.html | xclip -selection clipboard
# Import the file into Thunderbird
thunderbird --compose "message=myemail.html,format='html'"