Skip to content

Commit

Permalink
fix: email link
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftin committed Mar 23, 2024
1 parent c5448d0 commit 52f64e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion services/tasks/templates/email.tmpl
@@ -1,2 +1,2 @@
<p>Task {{ .Task.ID }} with template '{{ .Name }}' has failed!</p>
<p>Task Log: <a href="{{ .Task.URL }}">{{ .Task.URL }}</a></p>
<p>Task Log: <a href="{{ .Task.URL }}">Link</a></p>
16 changes: 7 additions & 9 deletions util/mailer/mailer.go
Expand Up @@ -12,7 +12,7 @@ import (
const (
mailerBase = "MIME-version: 1.0\r\n" +
"Content-Type: text/html; charset=UTF-8\r\n" +
"Content-Transfer-Encoding: quoted-printable\r\n" +
//"Content-Transfer-Encoding: quoted-printable\r\n" +
"Date: {{ .Date }}\r\n" +
"To: {{ .To }}\r\n" +
"From: {{ .From }}\r\n" +
Expand Down Expand Up @@ -49,7 +49,7 @@ func Send(
return err
}

if err := tpl.Execute(body, struct {
err = tpl.Execute(body, struct {
Date string
To string
From string
Expand All @@ -61,7 +61,9 @@ func Send(
From: r.Replace(from),
Subject: r.Replace(subject),
Body: content,
}); err != nil {
})

if err != nil {
return err
}

Expand Down Expand Up @@ -132,15 +134,11 @@ func anonymous(

defer c.Close()

if err := c.Mail(
r.Replace(from),
); err != nil {
if err := c.Mail(r.Replace(from)); err != nil {
return err
}

if err = c.Rcpt(
r.Replace(to),
); err != nil {
if err = c.Rcpt(r.Replace(to)); err != nil {
return err
}

Expand Down

0 comments on commit 52f64e3

Please sign in to comment.