The golang conditional construction moved out from the transifex template
This commit is contained in:
@@ -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,`),
|
Greeting: l10n.Template(`Hi,`),
|
||||||
// ScienceMeshInviteTokenGenerated email template, resolves via {{ .MessageBody }}
|
// ScienceMeshInviteTokenGenerated email template, resolves via {{ .MessageBody }}
|
||||||
MessageBody: l10n.Template(`{ShareSharer} ({ShareSharerMail}) wants to start sharing collaboration resources with you.
|
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}
|
{ShareLink}
|
||||||
|
|
||||||
Alternatively, you can{{else}}
|
Alternatively, you can visit your federation provider and use the following details:
|
||||||
Please{{end}} 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}
|
Token: {Token}
|
||||||
ProviderDomain: {ProviderDomain}`),
|
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(
|
msg, err := email.RenderEmailTemplate(
|
||||||
email.ScienceMeshInviteTokenGenerated,
|
emailTpl,
|
||||||
s.defaultLanguage, // fixMe: the recipient is unknown, should it be the defaultLocale?,
|
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.defaultLanguage, // fixMe: the defaultLocale is not set by default, shouldn't it be?,
|
||||||
s.emailTemplatePath,
|
s.emailTemplatePath,
|
||||||
|
|||||||
Reference in New Issue
Block a user