Allow to customize notification message (#415)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2021-06-25 23:24:02 +02:00
committed by GitHub
parent 066eafc8a9
commit 5d583809a0
43 changed files with 573 additions and 276 deletions

View File

@@ -9,6 +9,7 @@ type NotifMatrix struct {
PasswordFile string `yaml:"passwordFile,omitempty" json:"passwordFile,omitempty" validate:"omitempty,file"`
RoomID string `yaml:"roomID,omitempty" json:"roomID,omitempty" validate:"required"`
MsgType NotifMatrixMsgType `yaml:"msgType,omitempty" json:"msgType,omitempty" validate:"required,oneof=notice text"`
TemplateBody string `yaml:"templateBody,omitempty" json:"templateBody,omitempty" validate:"required"`
}
// NotifMatrix message type constants
@@ -31,4 +32,5 @@ func (s *NotifMatrix) GetDefaults() *NotifMatrix {
func (s *NotifMatrix) SetDefaults() {
s.HomeserverURL = "https://matrix.org"
s.MsgType = NotifMatrixMsgTypeNotice
s.TemplateBody = NotifDefaultTemplateBody
}