mirror of
https://github.com/documize/community.git
synced 2025-07-24 07:39:43 +02:00
i18n mail template strings
This commit is contained in:
parent
7255eb4f56
commit
17162ce336
16 changed files with 62 additions and 231 deletions
|
@ -16,6 +16,7 @@ package mail
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/documize/community/core/i18n"
|
||||
"github.com/documize/community/domain/smtp"
|
||||
)
|
||||
|
||||
|
@ -26,32 +27,32 @@ func (m *Mailer) DocumentApprover(recipient, inviterName, inviterEmail, url, doc
|
|||
|
||||
// check inviter name
|
||||
if inviterName == "Hello You" || len(inviterName) == 0 {
|
||||
inviterName = "Your colleague"
|
||||
inviterName = i18n.Localize(m.Context.Locale, "mail_template_sender")
|
||||
}
|
||||
|
||||
em := smtp.EmailMessage{}
|
||||
em.Subject = fmt.Sprintf("%s has granted you document approval", inviterName)
|
||||
em.Subject = i18n.Localize(m.Context.Locale, "mail_template_approval", inviterName)
|
||||
em.ToEmail = recipient
|
||||
em.ToName = recipient
|
||||
em.ReplyTo = inviterEmail
|
||||
em.ReplyName = inviterName
|
||||
|
||||
if IsBlockedEmailDomain(em.ToEmail) {
|
||||
return
|
||||
}
|
||||
|
||||
parameters := struct {
|
||||
Subject string
|
||||
Inviter string
|
||||
URL string
|
||||
Document string
|
||||
SenderEmail string
|
||||
ActionText string
|
||||
ClickHere string
|
||||
}{
|
||||
em.Subject,
|
||||
inviterName,
|
||||
url,
|
||||
document,
|
||||
m.Config.SenderEmail,
|
||||
i18n.Localize(m.Context.Locale, "mail_template_approval_explain"),
|
||||
i18n.Localize(m.Context.Locale, "mail_template_click_here"),
|
||||
}
|
||||
|
||||
html, err := m.ParseTemplate("mail/document-approver.html", parameters)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue