From 906f6e9f8ada28d09249a90c95d72d3cd4299045 Mon Sep 17 00:00:00 2001 From: Richard Guay Date: Tue, 1 Nov 2022 12:27:03 +0700 Subject: [PATCH] Fixing body message attachment order. Plain text was being shown before HTML text. --- app.go | 4 ++-- frontend/src/components/EmailIt.svelte | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app.go b/app.go index d093a19..309df7c 100644 --- a/app.go +++ b/app.go @@ -331,8 +331,8 @@ func (b *App) SendEmail(username string, from string, password string, host stri m.SetHeader("From", from) m.SetHeader("To", toList) m.SetHeader("Subject", subject) - m.SetBody("text/html", msg) - m.AddAlternative("text/plain", msgText) + m.SetBody("text/plain", msgText) + m.AddAlternative("text/html", msg) iport, _ := strconv.Atoi(port) d := mail.NewDialer(host, iport, username, password) d.TLSConfig = &tls.Config{InsecureSkipVerify: true} diff --git a/frontend/src/components/EmailIt.svelte b/frontend/src/components/EmailIt.svelte index 03aea9b..3e8cd0f 100644 --- a/frontend/src/components/EmailIt.svelte +++ b/frontend/src/components/EmailIt.svelte @@ -265,6 +265,7 @@ if (validate(toAddress)) { addToEmails(toAddress); var bodyText = bodyValue + cleanTags($account.signiture); + bodyText = $runtemplate('given',bodyText); showPreview = false; emailState = "edit";