Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Change email body and alternative templates types
Browse files Browse the repository at this point in the history
Swapped the methods for setting the body and alternative body of the email. Since the RFC recommends putting the main content at last, this prioritizes the HTML content over the text body. This change addresses wneessen/go-mail#251
  • Loading branch information
wneessen committed Jul 12, 2024
1 parent 874d3ba commit c10234e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions content/en/examples/bulk-mailer.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ func main() {
m.SetDate()
m.SetBulk()
m.Subject(fmt.Sprintf("%s, we have a great offer for you!", u.Firstname))
if err := m.SetBodyHTMLTemplate(htpl, u); err != nil {
log.Fatalf("failed to set HTML template as HTML body: %s", err)
if err := m.SetBodyTextTemplate(ttpl, u); err != nil {
log.Fatalf("failed to add text template to mail body: %s", err)
}
if err := m.AddAlternativeTextTemplate(ttpl, u); err != nil {
log.Fatalf("failed to set text template as alternative body: %s", err)
if err := m.AddAlternativeHTMLTemplate(htpl, u); err != nil {
log.Fatalf("failed to add HTML template to mail body: %s", err)
}

ms = append(ms, m)
Expand Down

0 comments on commit c10234e

Please sign in to comment.