branch: master
commit fe319a75a16bdc9a43175ed39f4ba233faf08a97
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
* smtpmail-async.el (async-smtpmail-before-send-hook): New hook that run on
child emacs before sending.
---
smtpmail-async.el | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/smtpmail-async.el b/smtpmail-async.el
index 76a9fb5..c5a9fac 100644
--- a/smtpmail-async.el
+++ b/smtpmail-async.el
@@ -41,6 +41,8 @@
(require 'async)
(require 'smtpmail)
+(defvar async-smtpmail-before-send-hook nil)
+
(defun async-smtpmail-send-it ()
(let ((to (message-field-value "To"))
(buf-content (buffer-substring-no-properties
@@ -54,8 +56,9 @@
(set-buffer-multibyte nil)
;; Pass in the variable environment for smtpmail
,(async-inject-variables
- "\\`\\(smtpmail\\|\\(user-\\)?mail\\)-"
+ "\\`\\(smtpmail\\|async-smtpmail\\|\\(user-\\)?mail\\)-"
nil
"\\`\\(mail-header-format-function\\|smtpmail-address-buffer\\|mail-mode-abbrev-table\\)")
+ (run-hooks 'async-smtpmail-before-send-hook)
(smtpmail-send-it)))
`(lambda (&optional ignore)
(message "Delivering message to %s...done" ,to)))))