fix: Uncomment the budget sync functionality, handle recipients string properly

This commit is contained in:
TheWanderingCrow 2025-12-22 10:11:59 -05:00
parent 100f8a5253
commit a2232ef7dc

View file

@ -144,9 +144,9 @@ func main() {
var smtpHost = os.Getenv("SMTP_HOST")
var smtpRecipients = os.Getenv("SMTP_RECIPIENTS")
client := CreateBudgetClient(baseUrl, apiKey, syncId)
//if !client.BankSync() {
// log.Println("Bank Sync failed, information may not be up to date")
//}
if !client.BankSync() {
log.Println("Bank Sync failed, information may not be up to date")
}
budgetMonths := client.GetBudgetMonths()
subject := "Subject: Budget Report\n"
@ -182,7 +182,7 @@ func main() {
} else {
auth = smtp.PlainAuth("", smtpUsername, smtpPassword, smtpHost)
}
err := smtp.SendMail(smtpHost, auth, smtpUsername, []string{smtpRecipients}, []byte(message))
err := smtp.SendMail(smtpHost, auth, smtpUsername, strings.Split(smtpRecipients, ","), []byte(message))
if err != nil {
log.Fatal(err)
}