diff --git a/Notifiers.md b/Notifiers.md index 3918380..183dbfd 100644 --- a/Notifiers.md +++ b/Notifiers.md @@ -64,12 +64,34 @@ var example = &Example{¬ifier.Notification{ ## Notifier Form Include a form with your notifier so other users can save API keys, username, passwords, and other values. +```go +// NotificationForm contains the HTML fields for each variable/input you want the notifier to accept. +type NotificationForm struct { + Type string `json:"type"` // the html input type (text, password, email) + Title string `json:"title"` // include a title for ease of use + Placeholder string `json:"placeholder"` // add a placeholder for the input + DbField string `json:"field"` // true variable key for input + SmallText string `json:"small_text"` // insert small text under a html input + Required bool `json:"required"` // require this input on the html form + IsHidden bool `json:"hidden"` // hide this form element from end user + IsList bool `json:"list"` // make this form element a comma separated list + IsSwitch bool `json:"switch"` // make the notifier a boolean true/false switch +} +``` -- `Type` the HTML input type (text, password, number, or email) -- `Title` - - - +### Example Notifier Form +This is the Slack Notifier `Form` fields. +```go +Form: []notifier.NotificationForm{{ + Type: "text", + Title: "Incoming webhooker Url", + Placeholder: "Insert your slack webhook URL here.", + SmallText: "Incoming webhooker URL from slack Apps", + DbField: "Host", + Required: true, + }} +} +``` ### Accepted DbField Values The `notifier.NotificationForm` has a field called `DbField` which is the column to save the value into the database. Below are the acceptable DbField string names to include in your form.