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
|
// Get task list as markdown
|
||||||
trelloCtx := NewTrello(config.TrelloToken)
|
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 {
|
if !trelloBoard.Starred || trelloBoard.Closed {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fmt.Printf("Loading board %s\n", trelloBoard.Name)
|
fmt.Printf("Loading board %s\n", trelloBoard.Name)
|
||||||
|
|
||||||
// trelloBoard := trelloCtx.GetBoard(config.TrelloUrl)
|
|
||||||
trelloMarkdown := trelloBoard.ExportToMarkdown()
|
trelloMarkdown := trelloBoard.ExportToMarkdown()
|
||||||
trelloHtml := trelloBoard.ExportToHtml()
|
trelloHtml := trelloBoard.ExportToHtml()
|
||||||
config.EmailSubject = fmt.Sprintf("Daily mail for %s", trelloBoard.Name)
|
config.EmailSubject = fmt.Sprintf("Daily mail for %s", trelloBoard.Name)
|
||||||
|
|
|
@ -50,9 +50,9 @@ func NewTransportAuth(config SmtpConfig) *smtp.Auth {
|
||||||
return &auth
|
return &auth
|
||||||
|
|
||||||
default:
|
default:
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func NewTransportTls(config SmtpConfig) *tls.Config {
|
func NewTransportTls(config SmtpConfig) *tls.Config {
|
||||||
// TLS config
|
// TLS config
|
||||||
|
@ -108,6 +108,12 @@ func (ctx *TransportCtx) Dial() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx *TransportCtx) Authenticate() {
|
func (ctx *TransportCtx) Authenticate() {
|
||||||
|
// guard
|
||||||
|
if ctx.Auth == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// ok, we have to
|
||||||
err := ctx.Client.Auth(*ctx.Auth)
|
err := ctx.Client.Auth(*ctx.Auth)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panic(err)
|
log.Panic(err)
|
||||||
|
|
Loading…
Reference in a new issue