mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-26 13:48:53 +08:00
NOISSUE: Fix emailer (#1219)
* update swagger Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * dont return nil Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * simplify emailer New Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
This commit is contained in:
parent
7dc6b0d879
commit
2453cd75ed
@ -60,7 +60,7 @@ func New(c *Config) (*Agent, error) {
|
||||
|
||||
tmpl, err := template.ParseFiles(c.Template)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(errParseTemplate, err)
|
||||
return a, errors.Wrap(errParseTemplate, err)
|
||||
}
|
||||
a.tmpl = tmpl
|
||||
return a, nil
|
||||
|
@ -19,10 +19,7 @@ type emailer struct {
|
||||
// New creates new emailer utility
|
||||
func New(url string, c *email.Config) (users.Emailer, error) {
|
||||
e, err := email.New(c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &emailer{resetURL: url, agent: e}, nil
|
||||
return &emailer{resetURL: url, agent: e}, err
|
||||
}
|
||||
|
||||
func (e *emailer) SendPasswordReset(To []string, host string, token string) error {
|
||||
|
@ -127,6 +127,7 @@ paths:
|
||||
description: JSON-formatted document containing user email.
|
||||
in: body
|
||||
schema:
|
||||
$ref: "#/parameters/Referer"
|
||||
$ref: "#/parameters/Authorization"
|
||||
$ref: "#/definitions/PasswordResetRequest"
|
||||
required: true
|
||||
|
Loading…
x
Reference in New Issue
Block a user