Better logs when link isn't readable
Anirudh Oppiliappan x@icyphox.sh
Fri, 01 Oct 2021 17:46:00 +0530
2 files changed,
2 insertions(+),
2 deletions(-)
M
mail/send.go
→
mail/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.go
→
main.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)