2018-08-21 08:36:54 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
// Examples
|
|
|
|
// - Sending emails with SSL : https://gist.github.com/chrisgillis/10888032
|
|
|
|
// - Project layout https://github.com/golang-standards/project-layout
|
|
|
|
// - Markdown rendering https://github.com/russross/blackfriday
|
|
|
|
|
|
|
|
import (
|
2018-08-21 23:50:50 +00:00
|
|
|
// "gopkg.in/russross/blackfriday.v2"
|
|
|
|
// "github.com/davecgh/go-spew/spew"
|
2018-08-21 08:36:54 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func BuildContent(config Config) []string {
|
|
|
|
// run taskell (download tasks from trello and export markdown)
|
|
|
|
// read file as an array
|
|
|
|
// insert trello board url
|
|
|
|
// convert to HTML
|
|
|
|
|
|
|
|
// output := blackfriday.Run(input, blackfriday.WithNoExtensions())
|
|
|
|
return []string{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func ImportFromTrello() {
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
// Setup config
|
|
|
|
config := NewConfig()
|
2018-08-21 23:50:50 +00:00
|
|
|
config.ParseEnv()
|
2018-08-21 08:36:54 +00:00
|
|
|
|
2018-08-21 17:21:46 +00:00
|
|
|
// Get task list as markdown
|
|
|
|
trelloCtx := NewTrello(config.Trello.Token)
|
|
|
|
trelloBoard := trelloCtx.GetBoard(config.Trello.Url)
|
|
|
|
trelloMarkdown := trelloBoard.ExportToMarkdown()
|
2018-08-21 23:50:50 +00:00
|
|
|
panic("samere")
|
2018-08-21 17:21:46 +00:00
|
|
|
|
2018-08-21 23:50:50 +00:00
|
|
|
// Create email enveloppe
|
2018-08-21 17:21:46 +00:00
|
|
|
email := NewEmail()
|
|
|
|
email.MakeHeaders(config.Email)
|
|
|
|
email.MakeBody(trelloMarkdown)
|
|
|
|
email.Send()
|
|
|
|
|
2018-08-21 23:50:50 +00:00
|
|
|
// Connect and send email
|
|
|
|
transport := NewTransport(config.Smtp)
|
|
|
|
transport.Dial()
|
|
|
|
transport.Authenticate()
|
2018-08-21 17:21:46 +00:00
|
|
|
transport.Send(email)
|
2018-08-21 23:50:50 +00:00
|
|
|
transport.Quit()
|
2018-08-21 08:36:54 +00:00
|
|
|
}
|