summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorCarlos Tadeu Panato Junior <ctadeu@gmail.com>2017-03-13 16:09:00 +0100
committerGeorge Goldberg <george@gberg.me>2017-03-13 15:09:00 +0000
commit38958d9ac4f415d9ae99dfcdb53bfdc355d96764 (patch)
tree6a92500ed7b9f13f0da0c1f84fc43b674621b36e /model
parent19c67d7fe35f92ae8a288dcdb9877d3bede41a61 (diff)
downloadchat-38958d9ac4f415d9ae99dfcdb53bfdc355d96764.tar.gz
chat-38958d9ac4f415d9ae99dfcdb53bfdc355d96764.tar.bz2
chat-38958d9ac4f415d9ae99dfcdb53bfdc355d96764.zip
Add implementation for POST /email/test apiV4 - Send Test Email (#5716)
Diffstat (limited to 'model')
-rw-r--r--model/client4.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go
index 629bc69dd..b6c2daf0f 100644
--- a/model/client4.go
+++ b/model/client4.go
@@ -146,6 +146,10 @@ func (c *Client4) GetSystemRoute() string {
return fmt.Sprintf("/system")
}
+func (c *Client4) GetTestEmailRoute() string {
+ return fmt.Sprintf("/email/test")
+}
+
func (c *Client4) GetIncomingWebhooksRoute() string {
return fmt.Sprintf("/hooks/incoming")
}
@@ -1065,6 +1069,15 @@ func (c *Client4) GetPing() (bool, *Response) {
}
}
+func (c *Client4) TestEmail() (bool, *Response) {
+ if r, err := c.DoApiPost(c.GetTestEmailRoute(), ""); err != nil {
+ return false, &Response{StatusCode: r.StatusCode, Error: err}
+ } else {
+ defer closeBody(r)
+ return CheckStatusOK(r), BuildResponse(r)
+ }
+}
+
// GetConfig will retrieve the server config with some sanitized items.
func (c *Client4) GetConfig() (*Config, *Response) {
if r, err := c.DoApiGet(c.GetConfigRoute(), ""); err != nil {