From 2b9059b57e2e904dd06e2efa96e4ad345d86bd8a Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Sat, 22 Oct 2022 20:45:27 -0400 Subject: make mail a little more flexible --- emacsconf-mail.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'emacsconf-mail.el') diff --git a/emacsconf-mail.el b/emacsconf-mail.el index c5ec599..12ba105 100644 --- a/emacsconf-mail.el +++ b/emacsconf-mail.el @@ -33,9 +33,9 @@ (email (plist-get (seq-find (lambda (o) (string= (plist-get o :slug) slug)) info) :email))) (assoc email grouped)))) -(defun emacsconf-mail-prepare (template group attrs) +(defun emacsconf-mail-prepare (template email attrs) (compose-mail - (car group) + email (emacsconf-replace-plist-in-string attrs (plist-get template :subject)) `(("Reply-To" . ,(emacsconf-replace-plist-in-string attrs (plist-get template :reply-to))) ("Mail-Followup-To" . ,(emacsconf-replace-plist-in-string attrs (plist-get template :mail-followup-to))) @@ -53,9 +53,8 @@ (emacsconf-mail-merge-get-template-from-subtree) (emacsconf-mail-merge-get-template (completing-read "Template: " (org-property-values "EMAIL_ID"))))) - (mail-func (plist-get template :function)) - (group (emacsconf-mail-complete-email-group))) - (funcall mail-func (cons user-mail-address (cdr group)) template))) + (mail-func (plist-get template :function))) + (funcall mail-func user-mail-address template))) (defun emacsconf-mail-template-to-group () "Prompt for a speaker and e-mail current template to them." @@ -89,7 +88,7 @@ (defun emacsconf-mail-group-by-email (info) (seq-group-by (lambda (o) (plist-get o :email)) info)) -(defun emacsconf-mail-speaker (&optional subject body) +(defun emacsconf-mail-speaker (&optional subject body talk) "Compose a message to the speaker of the current talk." (interactive) (compose-mail (format "%s <%s>" (org-entry-get (point) "NAME") (org-entry-get (point) "EMAIL")) subject) -- cgit v1.2.3