diff options
| author | Sacha Chua <sacha@sachachua.com> | 2025-12-03 14:39:31 -0500 |
|---|---|---|
| committer | Sacha Chua <sacha@sachachua.com> | 2025-12-03 14:39:31 -0500 |
| commit | ea96f2d6f7a9d96123ef5fab3c46d448088c6b8e (patch) | |
| tree | bf7c276fab5fcdeeb4f1d0d8e3feaadbe946bcda | |
| parent | f10330905c780ecfa55e07c231d515bb3cb4c637 (diff) | |
| download | emacsconf-el-ea96f2d6f7a9d96123ef5fab3c46d448088c6b8e.tar.xz emacsconf-el-ea96f2d6f7a9d96123ef5fab3c46d448088c6b8e.zip | |
handle schedule updates
| -rw-r--r-- | emacsconf-mail.el | 45 | ||||
| -rw-r--r-- | emacsconf-schedule.el | 8 |
2 files changed, 48 insertions, 5 deletions
diff --git a/emacsconf-mail.el b/emacsconf-mail.el index b3ef773..03db1fc 100644 --- a/emacsconf-mail.el +++ b/emacsconf-mail.el @@ -800,7 +800,7 @@ ${signature}" (defvar emacsconf-mail-bcc-email "*Extra e-mail address to Bcc for delivery confirmation.") -(defun emacsconf-mail-format-talk-schedule (o) +(defun emacsconf-mail-format-talk-schedule (o &optional old-schedule) "Format the schedule for O for inclusion in mail messages etc." (interactive (list (emacsconf-complete-talk))) (when (stringp o) @@ -815,6 +815,8 @@ ${signature}" (plist-get o :start-time) (plist-get o :timezone) "%b %-e %a %-I:%M %#p %Z")))) + (when old-schedule + (setq result (format "%s\n(Previous: %s)" result old-schedule))) (when (called-interactively-p 'any) (insert result)) result)) @@ -1620,6 +1622,47 @@ ${signature}")) (dolist (group (emacsconf-mail-groups (assoc-default t by-attendance))) (emacsconf-mail-checkin-instructions-for-attending-speakers group)))) +(defun emacsconf-mail-schedule-updates () + "E-mail general schedule updates." + (interactive) + (let* ((log-note (concat "sent schedule as of " (format-time-string "%Y-%m-%d"))) + (talks (emacsconf-filter-talks-by-logbook + log-note + (emacsconf-rescheduled-talks))) + (groups (emacsconf-mail-groups talks))) + (dolist (group groups) + (emacsconf-mail-prepare + (list + :subject "${conf-name} ${year}: Schedule update as of ${date}" + :reply-to "emacsconf-submit@gnu.org, ${email}, ${user-email}" + :mail-followup-to "emacsconf-submit@gnu.org, ${email}, ${user-email}" + :log-note log-note + :body + "Hello, ${speakers-short}! + +We tweaked the schedule a bit to adapt to some cancellations. Your new schedule is: + +${schedule} + +Let us know if you need to reschedule! + +${signature}") + (plist-get (car (cdr group)) :email) + (list + :year emacsconf-year + :base-url emacsconf-base-url + :conf-name emacsconf-name + :user-email user-mail-address + :date (format-time-string "%Y-%m-%d") + :email (plist-get (car (cdr group)) :email) + :speakers-short (plist-get (car (cdr group)) :speakers-short) + :signature user-full-name + :schedule + (mapconcat (lambda (talk) + (emacsconf-indent-string (emacsconf-mail-format-talk-schedule talk (plist-get talk :emailed-schedule)) 2)) + (cdr group) + "\n\n")))))) + (defun emacsconf-mail-interim-schedule-update (talk) "E-mail a quick update about the schedule." (interactive (list (emacsconf-complete-talk-info))) diff --git a/emacsconf-schedule.el b/emacsconf-schedule.el index cf5418b..cfc1340 100644 --- a/emacsconf-schedule.el +++ b/emacsconf-schedule.el @@ -288,16 +288,16 @@ Pairs with `emacsconf-schedule-dump-sexp'." (defun emacsconf-schedule-save-emailed-times (info &optional field force) (interactive (list (or emacsconf-schedule-draft (emacsconf-get-talk-info)) - (read-string "Field: ") current-prefix-arg)) + nil current-prefix-arg)) + (setq field (or field "EMAILED_SCHEDULE")) (save-window-excursion (save-excursion (mapc (lambda (talk) (emacsconf-go-to-talk (plist-get talk :slug)) (when (and (plist-get talk :scheduled) - (or force (null (org-entry-get (point) - (or field "ORIGINAL_SCHEDULE"))))) + (or force (null (org-entry-get (point) field)))) (org-entry-put (point) - (or field "ORIGINAL_SCHEDULE") + field (replace-regexp-in-string "[<>]" "" (plist-get talk :scheduled))))) (emacsconf-filter-talks info))))) |
