fix: Uncomment the budget sync functionality, handle recipients string properly
This commit is contained in:
parent
100f8a5253
commit
a2232ef7dc
1 changed files with 4 additions and 4 deletions
8
main.go
8
main.go
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue