complete-computing-environment/org-mime.org

45 lines
2.7 KiB
Org Mode

:PROPERTIES:
:ID: org_mime
:ROAM_ALIASES: "Org Mime" org-mime
:END:
#+TITLE: Sending Rich Text with Org Mime
#+filetags: :Emacs:CCE:Communication:
#+PROPERTY: header-args :mkdirp yes :results none
#+PROPERTY: header-args:emacs-lisp :tangle cce/org-mime.el
#+ARCOLOGY_KEY: cce/org-mime
#+ARCOLOGY_ALLOW_CRAWL: t
I wrote in my [[id:cce/gnus][Gnus]] configuration that I prefer plaintext email to HTML, but I aim to send HTML email by default in most situations[fn:2:I prefer to maintain plain-text conversation for one-on-one communication.]. Ironic that I'm willing and able to inflict HTML mail on the rest of the world, huh? Nah. I encourage people to make decisions based on choices they care about and I don't think most people care about this, and those who do have powerful enough tools to make that decision.
I don't believe that HTML mail should automatically opt you in to a surveillance panopticon, and I don't think it's reasonable to make insecure choices by default, vis a vis embedded images, and indeed reasonable systems should not display images by default. There are principled mail providers like ProtonMail and Hey.com which will alert and block HTML mail tracking technology. [[id:128ab0e8-a1c7-48bf-9efe-0c23ce906a48][Hypermedia]] and Hypertext are some of the better inventions and I think when used in good faith it can be a powerful tool.
And so I use it in good faith: With [[https://github.com/org-mime/org-mime][org-mime]] I use [[id:1fb8fb45-fac5-4449-a347-d55118bb377e][org-mode]] to draft my mail, attaching a "plain-text" org-mode markup along with an HTML export of that mail for folks with different dogmas than me. This allows me to reasonably attach well-formatted source code, links to documentation and research, and limited semantic markup to my documents. I promise I won't use Comic Sans:
#+ARROYO_EMACS_MODULE: org-mime
#+begin_src emacs-lisp :tangle cce/org-mime.el
(provide 'cce/org-mime)
(use-package org-mime
:after gnus
:config
(setq org-mime-library 'mml
org-mime-export-options '(:section-numbers nil
:with-author nil
:with-toc nil))
:bind
(:map message-mode-map ("C-c M-o" . org-mime-htmlize))
(:map org-mode-map ("C-c M-o" . org-mime-org-buffer-htmlize)))
#+end_src
With this loaded, I can add keywords to pages in my [[id:4cc8c5fc-ece0-4a34-8bf8-8fd0ac626bb4][Zettelkasten]] such that running =org-mime-org-buffer-htmlize= on a Zettel page will cause it to be mailed:
#+begin_example
,#+MAIL_TO: some1@some.place
,#+MAIL_SUBJECT: a subject line
,#+MAIL_CC: some2@some.place
,#+MAIL_BCC: some3@some.place
,#+MAIL_FROM: sender@some.place
#+end_example