mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-24 22:08:58 -05:00
The golang conditional construction moved out from the transifex template
This commit is contained in:
5
changelog/unreleased/fix-ocm-invite-email.md
Normal file
5
changelog/unreleased/fix-ocm-invite-email.md
Normal file
@@ -0,0 +1,5 @@
|
||||
Bugfix: Fixed the ocm email template
|
||||
|
||||
The golang conditional construction moved out from the transifex template.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/10030
|
||||
@@ -82,11 +82,24 @@ Even though this membership has expired you still might have access through othe
|
||||
Greeting: l10n.Template(`Hi,`),
|
||||
// ScienceMeshInviteTokenGenerated email template, resolves via {{ .MessageBody }}
|
||||
MessageBody: l10n.Template(`{ShareSharer} ({ShareSharerMail}) wants to start sharing collaboration resources with you.
|
||||
{{if .ShareLink }}To accept the invite, please visit the following URL:
|
||||
To accept the invite, please visit the following URL:
|
||||
{ShareLink}
|
||||
|
||||
Alternatively, you can{{else}}
|
||||
Please{{end}} visit your federation provider and use the following details:
|
||||
Alternatively, you can visit your federation provider and use the following details:
|
||||
Token: {Token}
|
||||
ProviderDomain: {ProviderDomain}`),
|
||||
}
|
||||
|
||||
ScienceMeshInviteTokenGeneratedWithoutShareLink = MessageTemplate{
|
||||
textTemplate: "templates/text/email.text.tmpl",
|
||||
htmlTemplate: "templates/html/email.html.tmpl",
|
||||
// ScienceMeshInviteTokenGeneratedWithoutShareLink email template, Subject field (resolves directly)
|
||||
Subject: l10n.Template(`ScienceMesh: {InitiatorName} wants to collaborate with you`),
|
||||
// ScienceMeshInviteTokenGeneratedWithoutShareLink email template, resolves via {{ .Greeting }}
|
||||
Greeting: l10n.Template(`Hi,`),
|
||||
// ScienceMeshInviteTokenGeneratedWithoutShareLink email template, resolves via {{ .MessageBody }}
|
||||
MessageBody: l10n.Template(`{ShareSharer} ({ShareSharerMail}) wants to start sharing collaboration resources with you.
|
||||
Please visit your federation provider and use the following details:
|
||||
Token: {Token}
|
||||
ProviderDomain: {ProviderDomain}`),
|
||||
}
|
||||
|
||||
@@ -57,8 +57,13 @@ func (s eventsNotifier) handleScienceMeshInviteTokenGenerated(e events.ScienceMe
|
||||
}
|
||||
}
|
||||
|
||||
emailTpl := email.ScienceMeshInviteTokenGenerated
|
||||
if e.InviteLink == "" {
|
||||
emailTpl = email.ScienceMeshInviteTokenGeneratedWithoutShareLink
|
||||
}
|
||||
|
||||
msg, err := email.RenderEmailTemplate(
|
||||
email.ScienceMeshInviteTokenGenerated,
|
||||
emailTpl,
|
||||
s.defaultLanguage, // fixMe: the recipient is unknown, should it be the defaultLocale?,
|
||||
s.defaultLanguage, // fixMe: the defaultLocale is not set by default, shouldn't it be?,
|
||||
s.emailTemplatePath,
|
||||
|
||||
Reference in New Issue
Block a user