All pastes #1521472 Raw Edit

Email reminder for Emacs org-mod

public text v1 · immutable
#1521472 ·published 2009-08-08 03:29 UTC
rendered paste body
(add-hook 'org-finalize-agenda-hook 'org-agenda-to-appt)
(setq appt-message-warning-time 10)
(setq appt-display-count 1)
(setq appt-email "cellphone@vtext.com")

;; Redefine function that displays appointment messages so it sends emails too
(defun appt-display-message (string mins)
  "Display a reminder about an appointment.
The string STRING describes the appointment, due in integer MINS minutes.
The format of the visible reminder is controlled by `appt-display-format'.
The variable `appt-audible' controls the audible reminder."
  (let ((appt-display-format
         (if (eq appt-display-format 'ignore)
               (cond (appt-msg-window 'window)
                     (appt-visible 'echo))
           appt-display-format)))
    (cond ((eq appt-display-format 'window)
           (funcall appt-disp-window-function
                    (number-to-string mins)
                    (format-time-string "%a %b %e " (current-time))
                    string)
           (run-at-time (format "%d sec" appt-display-duration)
                        nil
                        appt-delete-window-function))
          ((eq appt-display-format 'echo)
	   (shell-command (concat "echo " string "|mail " appt-email))))
           (message "%s" string)
    (if appt-audible (beep 1))))