1
0
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:
Mirko Teodorovic 2020-07-14 03:06:13 +02:00 committed by GitHub
parent 7dc6b0d879
commit 2453cd75ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 5 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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