about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--varuga.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/varuga.el b/varuga.el
index 1d17779..b7e24c3 100644
--- a/varuga.el
+++ b/varuga.el
@@ -138,14 +138,15 @@ is the length of the event in minutes."
                      (org-duration-to-minutes
                       (read-string "Duration: "))))
   (save-excursion
-    ;; Fill Subject header.
-    (save-restriction
-      (message-narrow-to-headers)
-      (re-search-forward "^Subject:")
-      (message-narrow-to-field)
-      (end-of-line)
-      ;; TODO: Allow customization of the Subject format.
-      (insert (format "Invitation: %s" summary)))
+    ;; Fill Subject header if it is blank.
+    (when (string-blank-p (message-fetch-field "Subject"))
+      (save-restriction
+        (message-narrow-to-headers)
+        (re-search-forward "^Subject:")
+        (message-narrow-to-field)
+        (end-of-line)
+        ;; TODO: Allow customization of the Subject format.
+        (insert (format "Invitation: %s" summary))))
     ;; Fill email body.
     (goto-char (point-max))
     (insert "<#multipart type=mixed>\n")