all repos — navani @ efd12d0e25b5a597b98dc3faef990157e10dfb20

forlater's primary mail processing service

Better logs when link isn't readable
Anirudh Oppiliappan x@icyphox.sh
Fri, 01 Oct 2021 17:46:00 +0530
commit

efd12d0e25b5a597b98dc3faef990157e10dfb20

parent

99c9e4751e5fe965bc1de27c9ad99f66f06e2330

2 files changed, 2 insertions(+), 2 deletions(-)

jump to
M mail/send.gomail/send.go

@@ -45,7 +45,7 @@ email.SetSubject(article.Title)

email.SetBodyData(mail.TextPlain, plainContent) email.AddAlternative(mail.TextHTML, string(htmlContent)) } else { - email.SetSubject(article.URL.String()) + email.SetSubject("[forlater.email] Unable to read your link") email.SetBody(mail.TextPlain, fmt.Sprintf( "We were unable to parse your link: %s", article.URL.String(),
M main.gomain.go

@@ -56,7 +56,7 @@ } else {

log.Printf("sent mail to %s: %s\n", m.From, article.Title) } } else { - log.Printf("not readable: %s\n", err) + log.Printf("not readable: %s: %s\n", article.URL.String(), resp.MIMEType) err := mail.SendArticle(&article, m.From, false) if err != nil { log.Printf("error sending mail to: %s: %v\n", m.From, err)