]> git.ozlabs.org Git - next-scripts/blobdiff - send_email
send_email: tidy up
[next-scripts] / send_email
index de418730b6a0776d2aaa5e6a49d60c9ca44b98ef..9930ad2b10e4742ced3431ee54fc467a38bf0af6 100755 (executable)
@@ -1,10 +1,13 @@
 #!/bin/bash
 
+mail_dir=$(realpath --relative-to=. "$(dirname "$0")/../mails")
+printf -v TARGET '%s/%(i%Y-%m-%d+%s)T.email' "$mail_dir" -1
+
 to="$1"
 cc="$2"
 subject="$3"
 
-(
+{
        cat <<EOF
 To: $to
 Cc: $cc
@@ -12,6 +15,10 @@ Subject: $subject
 
 EOF
        cat
-) | claws-mail --compose-from-file -
+} > "$TARGET"
+
+gvim "$TARGET"
+
+printf 'When you are finished editing you need to send %s\n' "$TARGET"
 
 exit 0