Add implementation for POST /email/test apiV4 - Send Test Email (#5716)
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
19c67d7fe3
Коммит
38958d9ac4
@@ -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 {
|
||||
|
||||
Ссылка в новой задаче
Block a user