Fix bug regarding multiple trello board selection
This commit is contained in:
parent
7d00226118
commit
0ff79c1aab
2 changed files with 17 additions and 3 deletions
|
@ -11,13 +11,21 @@ func main() {
|
|||
|
||||
// Get task list as markdown
|
||||
trelloCtx := NewTrello(config.TrelloToken)
|
||||
for _, trelloBoard := range trelloCtx.GetBoards() {
|
||||
|
||||
var trelloBoardsList []TrelloBoard
|
||||
if len(config.TrelloUrl) > 0 {
|
||||
trelloBoard := trelloCtx.GetBoard(config.TrelloUrl)
|
||||
trelloBoardsList = append(trelloBoardsList, trelloBoard)
|
||||
} else {
|
||||
trelloBoardsList = trelloCtx.GetBoards()
|
||||
}
|
||||
|
||||
for _, trelloBoard := range trelloBoardsList {
|
||||
if !trelloBoard.Starred || trelloBoard.Closed {
|
||||
continue
|
||||
}
|
||||
fmt.Printf("Loading board %s\n", trelloBoard.Name)
|
||||
|
||||
// trelloBoard := trelloCtx.GetBoard(config.TrelloUrl)
|
||||
trelloMarkdown := trelloBoard.ExportToMarkdown()
|
||||
trelloHtml := trelloBoard.ExportToHtml()
|
||||
config.EmailSubject = fmt.Sprintf("Daily mail for %s", trelloBoard.Name)
|
||||
|
|
|
@ -50,8 +50,8 @@ func NewTransportAuth(config SmtpConfig) *smtp.Auth {
|
|||
return &auth
|
||||
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewTransportTls(config SmtpConfig) *tls.Config {
|
||||
|
@ -108,6 +108,12 @@ func (ctx *TransportCtx) Dial() {
|
|||
}
|
||||
|
||||
func (ctx *TransportCtx) Authenticate() {
|
||||
// guard
|
||||
if ctx.Auth == nil {
|
||||
return
|
||||
}
|
||||
|
||||
// ok, we have to
|
||||
err := ctx.Client.Auth(*ctx.Auth)
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
|
|
Loading…
Reference in a new issue