Fix email sending on the sudo page
This commit is contained in:
parent
2d61532dd1
commit
4100263393
3 changed files with 12 additions and 3 deletions
|
|
@ -86,7 +86,16 @@ func Send(ctx context.Context, email Request) (result emailResponse, err error)
|
|||
}
|
||||
|
||||
if r.IsError() {
|
||||
log.Error().Int("status", err_resp.StatusCode).Str("error", err_resp.Error).Str("msg", err_resp.Message).Msg("Email send error")
|
||||
log.Error().
|
||||
Int("status", err_resp.StatusCode).
|
||||
Str("error", err_resp.Error).
|
||||
Str("msg", err_resp.Message).
|
||||
Str("email.from", email.From).
|
||||
Str("email.sender", email.Sender).
|
||||
Str("email.subject", email.Subject).
|
||||
Str("email.to", email.To).
|
||||
Str("email.text", email.Text).
|
||||
Msg("Email send error")
|
||||
return result, fmt.Errorf("Error response %d from email service: %s (%s)", err_resp.StatusCode, err_resp.Message, err_resp.Error)
|
||||
}
|
||||
return result, nil
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@
|
|||
<form action="/sudo/email" method="POST">
|
||||
<div class="mb-3">
|
||||
<label for="emailFrom" class="form-label">From Account</label>
|
||||
<select class="form-select" id="emailFrom">
|
||||
<select class="form-select" id="emailFrom" name="emailFrom">
|
||||
<option value="{{ .C.ForwardEmailRMOAddress }}">
|
||||
{{ .C.ForwardEmailRMOAddress }}
|
||||
</option>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ func postSudoEmail(ctx context.Context, u *models.User, e FormEmail) (string, *e
|
|||
if err != nil {
|
||||
log.Warn().Err(err).Msg("Failed to send email")
|
||||
} else {
|
||||
log.Info().Str("id", resp.ID).Msg("Sent Email...?")
|
||||
log.Info().Str("id", resp.ID).Str("to", e.To).Msg("Sent Email")
|
||||
}
|
||||
return "/sudo", nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue