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

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

[elpa] externals/org-notify 13afc93024 08/23: Add support for sending em


From: ELPA Syncer
Subject: [elpa] externals/org-notify 13afc93024 08/23: Add support for sending emails.
Date: Mon, 25 Jul 2022 12:57:56 -0400 (EDT)

branch: externals/org-notify
commit 13afc93024aad4b3f6b91d9716e61cb28814b8c4
Author: Peter Münster <pmrb@free.fr>
Commit: Peter Münster <pmrb@free.fr>

    Add support for sending emails.
    
    org-notify.el (org-notify-action-email): new function
---
 org-notify.el | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/org-notify.el b/org-notify.el
index ccee3601c8..317e53a7c5 100644
--- a/org-notify.el
+++ b/org-notify.el
@@ -245,10 +245,23 @@ for SECS is 50."
     (run-with-timer (or (plist-get plist :duration) 3) nil
                     'cancel-timer timer)))
 
+(defun org-notify-body-text (deadline)
+  "Make human readable string for remaining time to deadline.
+This time in seconds is provided by DEADLINE."
+  (require 'gnus-art)
+  (replace-regexp-in-string
+   " in the future" ""
+   (article-lapsed-string (time-add (current-time)
+                                    (seconds-to-time deadline))
+                          2)))
+
 (defun org-notify-action-email (plist)
   "Send email to user."
-; todo
-)
+  (compose-mail user-mail-address (concat "TODO: " (plist-get plist :heading)))
+  (insert (org-notify-body-text (plist-get plist :deadline)))
+  (funcall send-mail-function)
+  (flet ((yes-or-no-p (prompt) t))
+    (kill-buffer)))
 
 (defun org-notify-select-highest-window ()
   "Select the highest window on the frame, that is not is not an
@@ -301,16 +314,6 @@ org-notify window. Mostly copied from 
`appt-select-lowest-window'."
         (set-buffer-modified-p nil)       (setq buffer-read-only t)
         (raise-frame (selected-frame))    (select-window this-window)))))
 
-(defun org-notify-body-text (deadline)
-  "Make human readable string for remaining time to deadline.
-This time in seconds is provided by DEADLINE."
-  (require 'gnus-art)
-  (replace-regexp-in-string
-   " in the future" ""
-   (article-lapsed-string (time-add (current-time)
-                                    (seconds-to-time deadline))
-                          2)))
-
 (defun org-notify-action-notify (plist)
   "Pop up a notification window."
 ; todo perhaps: dbus-unregister-service for NotificationClosed to



reply via email to

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