(ctx context.Context, email string)
| 72 | } |
| 73 | |
| 74 | func (a *API) validateEmail(ctx context.Context, email string) error { |
| 75 | if email == "" { |
| 76 | return unprocessableEntityError("An email address is required") |
| 77 | } |
| 78 | mailer := a.Mailer(ctx) |
| 79 | if err := mailer.ValidateEmail(email); err != nil { |
| 80 | return unprocessableEntityError("Unable to validate email address: " + err.Error()) |
| 81 | } |
| 82 | return nil |
| 83 | } |
no test coverage detected