]> git.ozlabs.org Git - next-scripts/blob - send_email
send_email: allow multiple cc's and use that in message_helper
[next-scripts] / send_email
1 #!/bin/bash
2
3 mail_dir=$(realpath --relative-to=. "$(dirname "$0")/../mails")
4 printf -v TARGET '%s/%(i%Y-%m-%d+%s)T.email' "$mail_dir" -1
5
6 subject="$1"
7 shift
8 to="$1"
9 shift
10
11 {
12         printf 'To: %s\n' "$to"
13         printf 'Cc: %s\n' "$@"
14         printf 'Subject: %s\n\n' "$subject"
15         cat
16 } > "$TARGET"
17
18 gvim "$TARGET"
19
20 printf 'When you are finished editing you need to send %s\n' "$TARGET"
21
22 exit 0