diff --git a/modules/structs/mail.go b/modules/structs/mail.go
index 87fd5a5..d284206 100644
--- a/modules/structs/mail.go
+++ b/modules/structs/mail.go
@@ -134,6 +134,18 @@ func (m *Mail) RenderTemplate() (htmlBody, textBody string, err error) {
htmlBuf := new(bytes.Buffer)
textBuf := new(bytes.Buffer)
+ fmt.Println("BODY DATA", m.BodyData)
+
+ // parse body data to new map to avoid changing the original map and then replace all \n with
+
+ bodyData := make(map[string]interface{})
+
+ for key, value := range m.BodyData.(map[string]interface{}) {
+ bodyData[key] = strings.ReplaceAll(value.(string), "\n", "
")
+ }
+
+ m.BodyData = bodyData
+
if err := htmlTemplate.Execute(htmlBuf, m.BodyData); err != nil {
return "", "", err
}