aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hooks')
-rw-r--r--lib/hooks/mail-added.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/hooks/mail-added.go b/lib/hooks/mail-added.go
new file mode 100644
index 00000000..f146d010
--- /dev/null
+++ b/lib/hooks/mail-added.go
@@ -0,0 +1,23 @@
+package hooks
+
+import (
+ "fmt"
+
+ "git.sr.ht/~rjarry/aerc/config"
+)
+
+type MailAdded struct {
+ Account string
+ Folder string
+}
+
+func (m *MailAdded) Cmd() string {
+ return config.Hooks.MailAdded
+}
+
+func (m *MailAdded) Env() []string {
+ return []string{
+ fmt.Sprintf("AERC_ACCOUNT=%s", m.Account),
+ fmt.Sprintf("AERC_FOLDER=%s", m.Folder),
+ }
+}