https://pinot.apache.org/ logo
#daily-digest
Title
# daily-digest
x

Xiang Fu

02/04/2022, 6:23 AM
hmmm, might be issue with Sendgrid?
s

Seunghyun

02/07/2022, 8:01 PM
Copy code
func SendEmailViaGmail(c *Config, subject string, htmlContent string) string {
	d := gomail.NewDialer("<http://smtp.gmail.com|smtp.gmail.com>", 587, c.GmailAccount, c.GmailAppPassword)
	d.TLSConfig = &tls.Config{InsecureSkipVerify: true}

	// Send emails using d.
	m := gomail.NewMessage()
	m.SetAddressHeader("From", c.From, "Pinot Slack Email Digest")
	m.SetHeader("To", <http://c.To|c.To>)
	m.SetHeader("Subject", subject)
	m.SetBody("text/html", htmlContent)

	err := d.DialAndSend(m)
	if err != nil {
		fmt.Println("Failed to send the mail via Sendgrid:  " + err.Error())
		return "Failed to send mail via Sendgrid: " + err.Error()
	} else {
		msg := fmt.Sprintf("Daily digest successfully sent with the title: `%s`\n", DigestTitle())
		fmt.Println(msg)
		return msg
	}
}
Log is misleading lol. We try to send the mail via Google smtp server but I log it as
Failed to send the mail via Sendgrid
. Sendgrid needs to be changed to
Google SMTP
. I copied the block from another function. Anyway, it looks that the usersname & password doesn’t match
message has been deleted
So, I think that we may need to re-publish the app password for
apachepinot
account
and update those for your deployment
@User
x

Xiang Fu

02/07/2022, 8:07 PM
yes, I changed the password and updated, but seems no luck
will give a try again
2 Views