summaryrefslogtreecommitdiffstats
path: root/emacsconf-mail.el
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2023-09-12 11:40:12 -0400
committerSacha Chua <sacha@sachachua.com>2023-09-12 11:40:12 -0400
commit3953c80bfd1dc5fe523edff26c824eefd22a7fdb (patch)
treec970a429fe83f7b09bcbd24ba2c351b1860f008c /emacsconf-mail.el
parenta480fbdb04d86a487dee97386340a4e5320e0072 (diff)
downloademacsconf-el-3953c80bfd1dc5fe523edff26c824eefd22a7fdb.tar.xz
emacsconf-el-3953c80bfd1dc5fe523edff26c824eefd22a7fdb.zip
Add documentation, improve mail parsing
Diffstat (limited to 'emacsconf-mail.el')
-rw-r--r--emacsconf-mail.el29
1 files changed, 16 insertions, 13 deletions
diff --git a/emacsconf-mail.el b/emacsconf-mail.el
index 0a88e75..b0f5aa6 100644
--- a/emacsconf-mail.el
+++ b/emacsconf-mail.el
@@ -246,17 +246,18 @@ Group by e-mail."
(defun emacsconf-mail-parse-submission (body)
"Extract data from EmacsConf 2023 submissions in BODY."
- (let (data
- (fields '((:title "^Talk title")
- (:description "^Talk description")
- (:format "^Format")
- (:intro "^Introduction for you and your talk")
- (:name "^Speaker name")
- (:availability "^Speaker availability")
- (:q-and-a "^Preferred Q&A approach")
- (:public "^Public contact information")
- (:private "^Private emergency contact information")
- (:release "^Please include this speaker release"))))
+ (when (listp body) (setq body (plist-get (car body) :content)))
+ (let ((data (list :body body))
+ (fields '((:title "^[* ]*Talk title")
+ (:description "^[* ]*Talk description")
+ (:format "^[* ]*Format")
+ (:intro "^[* ]*Introduction for you and your talk")
+ (:name "^[* ]*Speaker name")
+ (:availability "^[* ]*Speaker availability")
+ (:q-and-a "^[* ]*Preferred Q&A approach")
+ (:public "^[* ]*Public contact information")
+ (:private "^[* ]*Private emergency contact information")
+ (:release "^[* ]*Please include this speaker release"))))
(with-temp-buffer
(insert body)
(goto-char (point-min))
@@ -299,12 +300,14 @@ other volunteers want to chime in regarding your talk. =)
"
notification-date)))))
+;; Documented in https://sachachua.com/blog/2023/09/emacsconf-capturing-submissions-from-e-mails/
;;;###autoload
(defun emacsconf-mail-add-submission (slug)
"Add the submission from the current e-mail."
(interactive "MTalk ID: ")
(let* ((props (notmuch-show-get-message-properties))
- (from (plist-get (plist-get props :headers) :From))
+ (from (or (plist-get (plist-get props :headers) :Reply-To)
+ (plist-get (plist-get props :headers) :From)))
(body (plist-get
(car
(plist-get props :body))
@@ -356,7 +359,7 @@ other volunteers want to chime in regarding your talk. =)
(replace-regexp-in-string "\n+" " "
(plist-get data :q-and-a))))
(save-excursion
- (insert body))
+ (insert (plist-get data :body)))
(re-search-backward org-drawer-regexp)
(org-fold-hide-drawer-toggle 'off)
(org-end-of-meta-data)