Added some printing while sending so you can tell it's not stuck

This commit is contained in:
Asaf Gartner 2023-09-13 00:56:00 +03:00
parent 2be63ef237
commit 13389fa2db
1 changed files with 2 additions and 0 deletions

View File

@ -273,6 +273,7 @@ type PostmarkBatchResult struct {
} }
func sendMail(cfg Config, recipients []string, subject, contentHtml string) ([]PostmarkBatchResult, error) { func sendMail(cfg Config, recipients []string, subject, contentHtml string) ([]PostmarkBatchResult, error) {
fmt.Printf("Sending batch [%d recipients]...", len(recipients))
from := cfg.FromAddress from := cfg.FromAddress
if cfg.FromName != "" { if cfg.FromName != "" {
from = fmt.Sprintf("%s <%s>", cfg.FromName, cfg.FromAddress) from = fmt.Sprintf("%s <%s>", cfg.FromName, cfg.FromAddress)
@ -322,6 +323,7 @@ func sendMail(cfg Config, recipients []string, subject, contentHtml string) ([]P
fmt.Printf("Batch sent successfully, but failed to parse response from postmark.\n") fmt.Printf("Batch sent successfully, but failed to parse response from postmark.\n")
return nil, nil return nil, nil
} }
fmt.Printf("Done.\n")
return results, nil return results, nil
} }