package web_server import ( "github.com/russross/blackfriday/v2" "github.com/GRFreire/nthmail/pkg/mail_utils" ) templ mail_body_comp(rcpt_addr string, m mail_utils.Mail_obj) { nthmail.xyz @styles() @header(rcpt_addr)
From:

{ m.From }

Subject:

{ m.Subject }

At:

{ m.Date.Format("15:04:05 02/01/2006") }

@mime_type(m.Body[m.PreferedBodyIndex])
} templ mime_type(b mail_utils.Mail_body) { switch b.MimeType { case mail_utils.Html: @body_html(b.Data) case mail_utils.Markdown: @body_markdown(b.Data) case mail_utils.PlainText: @body_plain(b.Data) default: @body_plain(b.Data) } } templ body_plain(s string) {
			{ s }
		
} templ body_html(s string) {
@templ.Raw(s)
} templ body_markdown(s string) {
{ string(blackfriday.Run([]byte(s))) }
}