emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/org-mime 470808cc14 070/118: Added support for MAIL_FROM p


From: ELPA Syncer
Subject: [nongnu] elpa/org-mime 470808cc14 070/118: Added support for MAIL_FROM property
Date: Wed, 5 Jan 2022 07:58:47 -0500 (EST)

branch: elpa/org-mime
commit 470808cc14bddd61e2229358443856b793a979bd
Author: Nick Anderson <nick@cmdln.org>
Commit: Nick Anderson <nick@cmdln.org>

    Added support for MAIL_FROM property
---
 org-mime.el | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/org-mime.el b/org-mime.el
index 0d9add81c6..0fb34a3954 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -43,13 +43,14 @@
 ;;
 ;; `org-mime-org-subtree-htmlize' is similar to `org-mime-org-buffer-htmlize'
 ;; but works on current subtree. It can read following subtree properties:
-;; MAIL_SUBJECT, MAIL_TO, MAIL_CC, and MAIL_BCC.
+;; MAIL_SUBJECT, MAIL_TO, MAIL_FROM, MAIL_CC, and MAIL_BCC.
 ;;
 ;; Here is the sample of a subtree:
 ;; * mail one
 ;;   :PROPERTIES:
 ;;   :MAIL_SUBJECT: mail title
 ;;   :MAIL_TO: person1@gmail.com
+;;   :MAIL_FROM: sender@gmail.com
 ;;   :MAIL_CC: person2@gmail.com
 ;;   :MAIL_BCC: person3@gmail.com
 ;;   :END:
@@ -479,16 +480,20 @@ If SUBTREEP is t, curret org node is subtree."
     (message "Warning: org-element-map is not available. File keywords will 
not work.")
     '())))
 
-(defun org-mime-build-mail-other-headers (cc bcc)
-  "Build mail header from CC and BCC."
+(defun org-mime-build-mail-other-headers (cc bcc from)
+  "Build mail header from CC, BCC, and FROM."
   (cond
-   ((and cc bcc)
+   ((and cc bcc from)
     (list (cons "Cc" cc)
-          (cons "Bcc" bcc)))
+          (cons "Bcc" bcc)
+          (cons "From" from)
+          ))
    (cc
     (list (cons "Cc" cc)))
    (bcc
     (list (cons "Bcc" bcc)))
+   (from
+    (list (cons "From" from)))
    (t
     nil)))
 
@@ -503,6 +508,7 @@ The following file keywords can be used to control the 
headers:
 #+MAIL_SUBJECT: a subject line
 #+MAIL_CC: some2@some.place
 #+MAIL_BCC: some3@some.place
+#+MAIL_FROM: sender@some.place
 
 The cursor ends in the TO field."
   (interactive)
@@ -520,7 +526,8 @@ The cursor ends in the TO field."
          (to (cdr (assoc "MAIL_TO" keywords)))
          (cc (cdr (assoc "MAIL_CC" keywords)))
          (bcc (cdr (assoc "MAIL_BCC" keywords)))
-         (other-headers (org-mime-build-mail-other-headers cc bcc)))
+         (from (cdr (assoc "MAIL_FROM" keywords)))
+         (other-headers (org-mime-build-mail-other-headers cc bcc from)))
     (org-mime-compose exported file to subject other-headers nil)
     (message-goto-to)))
 
@@ -543,6 +550,7 @@ Following headline properties can determine the mail 
headers,
   :MAIL_TO: person1@gmail.com
   :MAIL_CC: person2@gmail.com
   :MAIL_BCC: person3@gmail.com
+  :MAIL_FROM: sender@gmail.com
   :END:
 "
   (interactive "P")
@@ -562,8 +570,9 @@ Following headline properties can determine the mail 
headers,
              (to (org-mime-attr "MAIL_TO"))
              (cc (org-mime-attr "MAIL_CC"))
              (bcc (org-mime-attr "MAIL_BCC"))
+             (from (org-mime-attr "MAIL_FROM"))
              ;; Thanks to Matt Price improving handling of cc & bcc headers
-             (other-headers (org-mime-build-mail-other-headers cc bcc))
+             (other-headers (org-mime-build-mail-other-headers cc bcc from))
              (org-export-show-temporary-export-buffer nil)
              (subtree-opts (when (fboundp 'org-export--get-subtree-options)
                              (org-export--get-subtree-options)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]