summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2011-01-28 12:53:36 -0700
committerEric Schulte <schulte.eric@gmail.com>2011-01-28 12:53:36 -0700
commite612d0b9ff5be52183cbce64cfbbccc3d9d2c7c6 (patch)
tree56245d08bd38de2d7582162e215052a628cda057
parentb2ae35471f8559856274940491cd7526437472c7 (diff)
downloadorg-mode-e612d0b9ff5be52183cbce64cfbbccc3d9d2c7c6.tar.gz
org-mime: now possible to set mail subjects using the mail_subject property
-rw-r--r--contrib/lisp/org-mime.el31
1 files changed, 16 insertions, 15 deletions
diff --git a/contrib/lisp/org-mime.el b/contrib/lisp/org-mime.el
index 2337141..d8bbb2e 100644
--- a/contrib/lisp/org-mime.el
+++ b/contrib/lisp/org-mime.el
@@ -235,21 +235,22 @@ export that region, otherwise export the entire body."
(save-restriction
(org-narrow-to-subtree)
(run-hooks 'org-mime-send-subtree-hook)
- (let* ((file (buffer-file-name (current-buffer)))
- (subject (nth 4 (org-heading-components)))
- (to (org-entry-get nil "MAIL_TO" org-mime-use-property-inheritance))
- (cc (org-entry-get nil "MAIL_CC" org-mime-use-property-inheritance))
- (bcc (org-entry-get nil "MAIL_BCC" org-mime-use-property-inheritance))
- (body (buffer-substring
- (save-excursion (goto-char (point-min))
- (forward-line 1)
- (when (looking-at "[ \t]*:PROPERTIES:")
- (re-search-forward ":END:" nil)
- (forward-char))
- (point))
- (point-max))))
- (org-mime-compose body (or fmt 'org) file to subject
- `((cc . ,cc) (bcc . ,bcc))))))
+ (flet ((mp (p) (org-entry-get nil p org-mime-use-property-inheritance)))
+ (let* ((file (buffer-file-name (current-buffer)))
+ (subject (or (mp "MAIL_SUBJECT") (nth 4 (org-heading-components))))
+ (to (mp "MAIL_TO"))
+ (cc (mp "MAIL_CC"))
+ (bcc (mp "MAIL_BCC"))
+ (body (buffer-substring
+ (save-excursion (goto-char (point-min))
+ (forward-line 1)
+ (when (looking-at "[ \t]*:PROPERTIES:")
+ (re-search-forward ":END:" nil)
+ (forward-char))
+ (point))
+ (point-max))))
+ (org-mime-compose body (or fmt 'org) file to subject
+ `((cc . ,cc) (bcc . ,bcc)))))))
(defun org-mime-send-buffer (&optional fmt)
(run-hooks 'org-mime-send-buffer-hook)