diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-05-14 13:07:48 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-05-14 13:07:48 -0400 |
commit | 6c36e04c1f7f7e222c71c5c8e7e7337744fe9c34 (patch) | |
tree | 52695aa088a565808275582f138cf673c0066d76 /commands/compose | |
parent | d5e82ecfe05065a84f1e13bee44e309b8e1559bd (diff) | |
download | aerc-6c36e04c1f7f7e222c71c5c8e7e7337744fe9c34.tar.gz |
Add :send-message, prepares & writes email to /tmp
Diffstat (limited to 'commands/compose')
-rw-r--r-- | commands/compose/send-message.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/commands/compose/send-message.go b/commands/compose/send-message.go new file mode 100644 index 00000000..b9fc9d2b --- /dev/null +++ b/commands/compose/send-message.go @@ -0,0 +1,29 @@ +package compose + +import ( + "errors" + "os" + + "git.sr.ht/~sircmpwn/aerc2/widgets" +) + +func init() { + register("send-message", SendMessage) +} + +func SendMessage(aerc *widgets.Aerc, args []string) error { + if len(args) > 1 { + return errors.New("Usage: send-message") + } + composer, _ := aerc.SelectedTab().(*widgets.Composer) + //config := composer.Config() + f, err := os.Create("/tmp/test.eml") + if err != nil { + panic(err) + } + _, err = composer.Message(f) + if err != nil { + panic(err) + } + return nil +} |