mailgun-debug

This commit is contained in:
Untone 2024-01-05 18:51:39 +03:00
parent 95807ae319
commit 2ccc2ae4eb

View File

@ -60,10 +60,12 @@ func MailgunRest(to string, data map[string]interface{}, subject string, templat
// Log the Mailgun API response
responseBody, err := io.ReadAll(resp.Body)
if err != nil {
log.Printf("Error %v reading Mailgun API response: %v", err, responseBody)
log.Printf("Error %v", err)
return err
}
log.Printf("Mailgun API response: %v", responseBody)
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("failed to send email, status: %d", resp.StatusCode)
}