Esempio n. 1
0
func clearHandler(responseWriter http.ResponseWriter, request *http.Request) {
	request.ParseForm()
	token := request.Form.Get("token")

	if validToken(token) && request.Method == "POST" {
		notable.Reset()
	}
}
Esempio n. 2
0
func main() {
	if port, err := strconv.Atoi(os.Getenv("SMTP_PORT")); err == nil {
		if len(notable.Notes()) > 0 {
			notable.SendEmail(
				os.Getenv("SMTP_HOST"),
				port,
				os.Getenv("SMTP_USERNAME"),
				os.Getenv("SMTP_PASSWORD"),
				os.Getenv("FROM_EMAIL"),
				os.Getenv("FROM_NAME"),
				os.Getenv("TO_EMAIL"),
				os.Getenv("TO_NAME"),
			)
			if os.Getenv("NO_RESET") == "" {
				notable.Reset()
			} else {
				log.Print("Not resetting notes")
			}
		}
	} else {
		log.Fatal(err)
	}
}
Esempio n. 3
0
func main() {
	if len(notable.Notes()) > 0 {
		notable.SendEmail(os.Getenv("MANDRILL_API_KEY"))
		notable.Reset()
	}
}