refactor ParseMessageFormat to use a ctx object
This commit is contained in:
parent
b6bcf89784
commit
75cbf76732
3 changed files with 74 additions and 60 deletions
config
|
@ -37,9 +37,12 @@ func (trig *TriggersConfig) ExecNewEmail(account *AccountConfig,
|
|||
err := trig.ExecTrigger(trig.NewEmail,
|
||||
func(part string) (string, error) {
|
||||
formatstr, args, err := format.ParseMessageFormat(
|
||||
account.From,
|
||||
part,
|
||||
conf.Ui.TimestampFormat, account.Name, 0, msg, false)
|
||||
part, conf.Ui.TimestampFormat,
|
||||
format.Ctx{
|
||||
FromAddress: account.From,
|
||||
AccountName: account.Name,
|
||||
MsgInfo: msg},
|
||||
)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue