Ejemplo n.º 1
0
func renderMail(mail *mail.Mail, index int, totalMails int) {
	totalSpaces := strings.Repeat(" ", len(strconv.Itoa(totalMails)))
	remainingSpaces := strings.Repeat(" ", len(strconv.Itoa(totalMails))-len(strconv.Itoa(index+1)))

	fmt.Printf(" %s%v %s\n", utils.Green(index+1), remainingSpaces, utils.Yellow(mail.Title))
	fmt.Printf(" %v %s\n\n", totalSpaces, utils.Cyan(mail.SumUp))
}
Ejemplo n.º 2
0
func Render(mail *Mail) {

	fmt.Printf("---\n")
	fmt.Printf("From  : %s <%s>\n", utils.Magenta(mail.FromString), utils.Magenta(mail.FromMail))
	fmt.Printf("Title : %s\n", utils.Yellow(mail.Title))
	fmt.Printf("Date  : %s\n", utils.Blue(mail.Date.Format("2006-01-02 15:04")))
	fmt.Printf("---\n")
	fmt.Printf(utils.Cyan(mail.Body))
	fmt.Printf("\n---\n")
}