| 1 |
package hooks |
| 2 |
|
| 3 |
import ( |
| 4 |
"fmt" |
| 5 |
|
| 6 |
"git.sr.ht/~rjarry/aerc/config" |
| 7 |
) |
| 8 |
|
| 9 |
type MailAdded struct { |
| 10 |
Account string |
| 11 |
Backend string |
| 12 |
Folder string |
| 13 |
Role string |
| 14 |
} |
| 15 |
|
| 16 |
func (m *MailAdded) Cmd() string { |
| 17 |
return config.Hooks().MailAdded |
| 18 |
} |
| 19 |
|
| 20 |
func (m *MailAdded) Env() []string { |
| 21 |
return []string{ |
| 22 |
fmt.Sprintf("AERC_ACCOUNT=%s", m.Account), |
| 23 |
fmt.Sprintf("AERC_ACCOUNT_BACKEND=%s", m.Backend), |
| 24 |
fmt.Sprintf("AERC_FOLDER=%s", m.Folder), |
| 25 |
fmt.Sprintf("AERC_FOLDER_ROLE=%s", m.Role), |
| 26 |
} |
| 27 |
} |