diff --git a/src/NotificationConfiguration.Test/NotificationConfigurationTest.cs b/src/NotificationConfiguration.Test/NotificationConfigurationTest.cs index 6b9a1b62b4fa961866528c116ef982ddf3d5de8c..8fd7a0f5908395b8f9fd0d8ae905930200228dc5 100644 --- a/src/NotificationConfiguration.Test/NotificationConfigurationTest.cs +++ b/src/NotificationConfiguration.Test/NotificationConfigurationTest.cs @@ -13,6 +13,8 @@ namespace Coscine.NotificationConfiguration.Test private static readonly string _channelNameValid = "email"; private static readonly string _channelNameInvalid = "hfauifhsdksndah"; + private static readonly string _languageValid = "en"; + public NotificationConfigurationTest() { } @@ -73,5 +75,12 @@ namespace Coscine.NotificationConfiguration.Test Assert.True(notificationConfiguration.GetAllChannelsForAction(_actionNameValid).Count > 0); Assert.True(notificationConfiguration.GetAllChannelsForAction(_actionNameInvalid).Count == 0); } + + [Test] + public void TestGetAllPartialsForChannel() + { + Coscine.NotificationConfiguration.NotificationConfiguration notificationConfiguration = new Coscine.NotificationConfiguration.NotificationConfiguration(); + Assert.True(notificationConfiguration.GetPartialsForChannel(_channelNameValid, _languageValid).Count > 0); + } } } diff --git a/src/NotificationConfiguration.Test/Properties/AssemblyInfo.cs b/src/NotificationConfiguration.Test/Properties/AssemblyInfo.cs index 80fed60cccf1282eabc5d98efe9bc9980a798e35..543bfe531408b59ccd9c6194a32c7b285b47a193 100644 --- a/src/NotificationConfiguration.Test/Properties/AssemblyInfo.cs +++ b/src/NotificationConfiguration.Test/Properties/AssemblyInfo.cs @@ -9,8 +9,8 @@ using System.Reflection; [assembly: AssemblyDescription("NotificationConfiguration.Test is a part of the CoScInE group.")] [assembly: AssemblyCompany("IT Center, RWTH Aachen University")] [assembly: AssemblyProduct("NotificationConfiguration.Test")] -[assembly: AssemblyVersion("1.3.0")] -[assembly: AssemblyFileVersion("1.3.0")] -[assembly: AssemblyInformationalVersion("1.3.0-topic-1062-pidpa0001")] +[assembly: AssemblyVersion("1.4.0")] +[assembly: AssemblyFileVersion("1.4.0")] +[assembly: AssemblyInformationalVersion("1.4.0-topic-1127-email0006")] [assembly: AssemblyCopyright("2020 IT Center, RWTH Aachen University")] diff --git a/src/NotificationConfiguration/Actions.json b/src/NotificationConfiguration/Actions.json index ed17c543cc147a63d66fb6e90fc4d717c852bda3..286bb89dcae9ac8fdf5abb27795a882c61607fa4 100644 --- a/src/NotificationConfiguration/Actions.json +++ b/src/NotificationConfiguration/Actions.json @@ -9,11 +9,11 @@ "email": { "de": { "subject": "[CoScInE] Projekt gelöscht", - "body": "Das Projekt {{_projectName}} wurde gelöscht." + "body": "{{> header}}Das Projekt {{_projectName}} wurde gelöscht.{{> footer}}" }, "en": { "subject": "[CoScInE] Project deleted", - "body": "Project {{_projectName}} was deleted." + "body": "{{> header}}The Project {{_projectName}} was deleted.{{> footer}}" } } }, @@ -37,11 +37,11 @@ "email": { "de": { "subject": "[CoScInE] Projekt erstellt", - "body": "Das Projekt {{_projectName}} wurde erstellt." + "body": "{{> header}}Das Projekt {{_projectName}} wurde erstellt.{{> footer}}" }, "en": { "subject": "[CoScInE] Project created", - "body": "The project {{_projectName}} was created." + "body": "{{> header}}The project {{_projectName}} was created.{{> footer}}" } } }, @@ -65,11 +65,11 @@ "email": { "de": { "subject": "[CoScInE] Benutzer von Projekt entfernt", - "body": "Sie wurden von einem Projekt entfernt." + "body": "{{> header}}Sie wurden von einem Projekt entfernt.{{> footer}}" }, "en": { "subject": "[CoScInE] User removed from project", - "body": "You were removed from a project." + "body": "{{> header}}You were removed from a project.{{> footer}}" } } }, @@ -93,11 +93,11 @@ "email": { "de": { "subject": "[CoScInE] Benutzerrolle in Projekt geändert", - "body": "Ihre Rolle in dem Projekt {{_projectName}} wurde geändert." + "body": "{{> header}}Ihre Rolle in dem Projekt {{_projectName}} wurde geändert.{{> footer}}" }, "en": { "subject": "[CoScInE] User role changed in project", - "body": "Your role in the project {{_projectName}} was changed." + "body": "{{> header}}Your role in the project {{_projectName}} was changed.{{> footer}}" } } }, @@ -121,11 +121,11 @@ "email": { "de": { "subject": "[CoScInE] Ressource entfernt", - "body": "Es wurde eine Ressource im Projekt {{_projectName}} entfernt." + "body": "{{> header}}Es wurde eine Ressource im Projekt {{_projectName}} entfernt.{{> footer}}" }, "en": { "subject": "[CoScInE] Resource removed", - "body": "A resource was removed from the project {{_projectName}}." + "body": "{{> header}}A resource was removed from the project {{_projectName}}.{{> footer}}" } } }, @@ -149,11 +149,11 @@ "email": { "de": { "subject": "[CoScInE] Ressource erstellt", - "body": "Es wurde eine Ressource in dem Projekt {{_projectName}} erstellt." + "body": "{{> header}}Es wurde eine Ressource in dem Projekt {{_projectName}} erstellt.{{> footer}}" }, "en": { "subject": "[CoScInE] Resource created", - "body": "A resource was created in the project {{_projectName}}." + "body": "{{> header}}A resource was created in the project {{_projectName}}.{{> footer}}" } } }, @@ -177,11 +177,11 @@ "email": { "de": { "subject": "[CoScInE] Anfrage zu {{resourceName}} des Projekts {{_projectName}}", - "body": "Sehr geehrter {{_targetUserName}},\\n\\nEs wurde eine externe Anfrage bezüglich der Ressource {{resourceName}} Ihres Coscine-Projekts {{_projectName}} gesendet. \\nSie und alle anderen Projektinhaber haben diese Nachricht erhalten.\\n\\nBitte beachten Sie:\\nIhre E-Mail-Adresse wurde nicht an die Person weitergegeben, die die Anfrage initiiert hat. Die Nachricht wurde von Coscine weitergeleitet.\\n\\nWenn Sie sich dafür entscheiden, die Anfrage über die untenstehenden Kontaktinformationen zu beantworten, erhält die anfragende Person Informationen über Ihre E-Mail-Adresse.\\n\\nHaftungsausschluss: Der Inhalt der Anfrage wurde nicht von Coscine erstellt. Bitte melden Sie jeglichen Missbrauch des Kontaktformulars an servicedesk@itc.rwth-aachen.de\\n\\nMit freundlichen Grüßen\\nIhr Coscine-Team\\n \\n\\n--- \\n\\Anfrage Informationen \\nName: {{requesterName}}\nKontakt: {{requesterMail}}\n\nNachricht: {{requestMessage}}" + "body": "{{> header}}Sehr geehrter {{_targetUserName}},<br/><br/> Es wurde eine extern Anfrage bezüglich der Ressource {{resourceName}} Ihres Coscine-Projekts {{_projectName}} gesendet. <br/>Sie und alle anderen Projektinhaber haben diese Nachricht erhalten.<br/><br/>Bitte beachten Sie:<br/>Ihre E-Mail-Adresse wurde nicht an die Person weitergegeben, die die Anfrage initiiert hat. Die Nachricht wurde von Coscine weitergeleitet.<br/><br/>Wenn Sie sich dafür entscheiden, die Anfrage über die untenstehenden Kontaktinformationen zu beantworten, erhält die anfragende Person Informationen über Ihre E-Mail-Adresse.<br/><br/>Haftungsausschluss: Der Inhalt der Anfrage wurde nicht von Coscine erstellt. Bitte melden Sie jeglichen Missbrauch des Kontaktformulars an servicedesk@itc.rwth-aachen.de<br/><br/>Mit freundlichen Grüßen<br/>Ihr Coscine-Team<br/> <br/><br/>--- <br/><br/>Anfrage Informationen <br/>Name: {{requesterName}}<br/>Kontakt: {{requesterMail}}<br/><br/>Nachricht: {{requestMessage}}{{> footer}}" }, "en": { "subject": "[CoScInE] Request for {{resourceName}} of project {{_projectName}}", - "body": "Dear {{_targetUserName}}, \n\nan external request was sent, regarding the resource {{resourceName}} of your Coscine project: {{_projectName}}. \nYou and all other project owners have been relayed this message. \n\nPlease note: \nYour E-Mail adress was not disclosed to the person who initiated the requested. The message was relayed by Coscine. \n\nIf you choose to answer the request via the contact information below, the requesting person will gain information about your E-Mail address. \n\nDisclaimer: The content of the request was not created by Coscine. Please report any abuse of the contact form to servicedesk@itc.rwth-aachen.de \n\nBest regards \nYour Coscine team \n\n--- \n\nRequest Information \nName: {{requesterName}} \n\n\nContact Mail: {{requesterMail}} \n\n\nMessage: {{requestMessage}}" + "body": "{{> header}}Dear {{_targetUserName}}, <br/><br/> an external request was sent, regarding the resource {{resourceName}} of your Coscine project: {{_projectName}}. <br/>You and all other project owners have been relayed this message. <br/><br/>Please note: <br/>Your E-Mail adress was not disclosed to the person who initiated the requested. The message was relayed by Coscine. <br/><br/>If you choose to answer the request via the contact information below, the requesting person will gain information about your E-Mail address. <br/><br/>Disclaimer: The content of the request was not created by Coscine. Please report any abuse of the contact form to servicedesk@itc.rwth-aachen.de <br/><br/>Best regards <br/>Your Coscine team <br/><br/>--- <br/><br/>Request Information <br/>Name: {{requesterName}} <br/><br/><br/>Contact Mail: {{requesterMail}} <br/><br/><br/>Message: {{requestMessage}}{{> footer}}" } } }, @@ -190,7 +190,7 @@ "en": "PID Owner contacted" }, "description": { - "de": "Sie werden informiert, wenn der Besiter einer PID kontaktiert wird.", + "de": "Sie werden informiert, wenn der Besitzer einer PID kontaktiert wird.", "en": "You will be informed when a PID owner is contacted." }, "group": [] @@ -205,11 +205,11 @@ "email": { "de": { "subject": "[CoScInE] Anfrage zu PID: {{pid}}", - "body": "Hallo {{requesterName}},\n\nSie haben eine Anfrage zur PID {{pid}} gestellt.\n\nDie Nachricht wurde von Coscine an den Eigentümer weitergeleitet.\n\n\nMit freundlichen Grüßen\nIhr Coscine-Team\n\n\n---\n\nAnfrage \nName: {{requesterName}}\nKontakt: {{requesterMail}}\n\nNachricht: {{requestMessage}}" + "body": "{{> header}}Hallo {{requesterName}},<br/><br/>Sie haben eine Anfrage zur PID <b>{{pid}}</b> gestellt.<br/><br/>Die Nachricht wurde von Coscine an den Eigentümer weitergeleitet.<br/><br/><br/>Mit freundlichen Grüßen<br/>Ihr Coscine-Team<br/><br/><br/>---<br/><br/>Anfrage <br/>Name: {{requesterName}}<br/>Kontakt: {{requesterMail}}<br/><br/>Nachricht: {{requestMessage}}{{> footer}}" }, "en": { "subject": "[CoScInE] Request for PID: {{pid}}", - "body": "Hello {{requesterName}},\n\nYou have made an inquiry about the PID {{pid}}.\n\nThe message was forwarded by Coscine to the owner.\n\n\nWith kind regards\nYour Coscine Team\n\n\n---\n\nRequest \nName: {{requesterName}}\nContact Mail: {{requesterMail}}\n\nMessage: {{requestMessage}}" + "body": "{{> header}}Hello {{requesterName}},<br/><br/>You have made an inquiry about the PID <b>{{pid}}</b>.<br/><br/>The message was forwarded by Coscine to the owner.<br/><br/><br/>With kind regards<br/>Your Coscine Team<br/><br/><br/>---<br/><br/>Request <br/>Name: {{requesterName}}<br/>Contact Mail: {{requesterMail}}<br/><br/>Message: {{requestMessage}}{{> footer}}" } } }, diff --git a/src/NotificationConfiguration/Channels.json b/src/NotificationConfiguration/Channels.json index 85ad14a168ee3b35592b8bdc6da162128f8961f5..2ef25611851a9897dac69bca9f318d37ef09c776 100644 --- a/src/NotificationConfiguration/Channels.json +++ b/src/NotificationConfiguration/Channels.json @@ -2,7 +2,17 @@ "email": { "path": "NotificationChannelEmail\\Coscine.NotificationChannelEmail.dll", "args": { - "from": "coscine@itc.rwth-aachen.de" + "from": "coscine@itc.rwth-aachen.de", + "partials": { + "de": { + "header": "Header.tpl", + "footer": "Footer.tpl" + }, + "en": { + "header": "Header.tpl", + "footer": "Footer.tpl" + } + } }, "name": { "de": "E-Mail", diff --git a/src/NotificationConfiguration/NotificationConfiguration.cs b/src/NotificationConfiguration/NotificationConfiguration.cs index 7b6b6973a7512f1d526a71ed6230a06c37e5ee8f..dc625de7eb57e0d3e67c0102cb7523307d9a3a77 100644 --- a/src/NotificationConfiguration/NotificationConfiguration.cs +++ b/src/NotificationConfiguration/NotificationConfiguration.cs @@ -21,7 +21,7 @@ namespace Coscine.NotificationConfiguration var actionsJSON = GetJSONFromAssembly(actionsFileName); var channelsJSON = GetJSONFromAssembly(channelsFileName); - foreach(var action in actionsJSON) + foreach (var action in actionsJSON) { _actions.Add(action.Key, new ActionObject((JObject)action.Value)); } @@ -44,6 +44,24 @@ namespace Coscine.NotificationConfiguration } } + public static string GetStringFromAssembly(string fileName) + { + var assembly = Assembly.GetExecutingAssembly(); + using (Stream stream = assembly.GetManifestResourceStream(fileName)) + { + using (StreamReader reader = new StreamReader(stream)) + { + return reader.ReadToEnd(); + } + } + } + + public static string GetStringFromAssembly(string channel, string language, string fileName) + { + var path = $"Coscine.NotificationConfiguration.Partials.{UppercaseFirst(channel)}.{UppercaseFirst(language)}.{fileName}"; + return GetStringFromAssembly(path); + } + public bool IsValidAction(string action) { return _actions.ContainsKey(action); @@ -54,7 +72,7 @@ namespace Coscine.NotificationConfiguration return _channels.ContainsKey(channel); } - public ActionObject GetAction (string action) + public ActionObject GetAction(string action) { if (_actions.ContainsKey(action)) { @@ -71,6 +89,33 @@ namespace Coscine.NotificationConfiguration } return null; } + public Dictionary<string, string> GetPartialsForChannel(string channel, string language) + { + if (_channels.ContainsKey(channel)) + { + var args = _channels[channel].Args; + var dict = new Dictionary<string, string>(); + if (args["partials"] != null && args["partials"][language] != null) + { + var partialDict = args["partials"][language].ToObject<Dictionary<string, string>>(); + foreach (var partial in partialDict) + { + dict.Add(partial.Key, GetStringFromAssembly(channel, language, partial.Value)); + } + } + return dict; + } + return null; + } + + private static string UppercaseFirst(string str) + { + if (string.IsNullOrEmpty(str)) + { + return string.Empty; + } + return char.ToUpper(str[0]) + str.Substring(1); + } public List<string> GetAllChannelsForAction(string action) { diff --git a/src/NotificationConfiguration/NotificationConfiguration.csproj b/src/NotificationConfiguration/NotificationConfiguration.csproj index 5b21435c8a37ac630b99616146fb6101f341a5ff..3ed98693ba4d77d11e31d0bc24c2cd00dd7cbb08 100644 --- a/src/NotificationConfiguration/NotificationConfiguration.csproj +++ b/src/NotificationConfiguration/NotificationConfiguration.csproj @@ -55,6 +55,19 @@ <EmbeddedResource Include="Actions.json" /> <EmbeddedResource Include="Channels.json" /> <None Include="packages.config" /> + <EmbeddedResource Include="Partials\Email\De\Footer.tpl"> + <PackageCopyToOutput>true</PackageCopyToOutput> + </EmbeddedResource> + <EmbeddedResource Include="Partials\Email\De\Header.tpl"> + <PackageCopyToOutput>true</PackageCopyToOutput> + </EmbeddedResource> + <EmbeddedResource Include="Partials\Email\En\Footer.tpl"> + <PackageCopyToOutput>true</PackageCopyToOutput> + </EmbeddedResource> + <EmbeddedResource Include="Partials\Email\En\Header.tpl"> + <PackageCopyToOutput>true</PackageCopyToOutput> + </EmbeddedResource> </ItemGroup> + <ItemGroup /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project> \ No newline at end of file diff --git a/src/NotificationConfiguration/Properties/AssemblyInfo.cs b/src/NotificationConfiguration/Properties/AssemblyInfo.cs index 1b1c1f1623b58b7d23e6db9957b04353456f3537..6c92bda36c892eaf5ed431e9f2225970748d8565 100644 --- a/src/NotificationConfiguration/Properties/AssemblyInfo.cs +++ b/src/NotificationConfiguration/Properties/AssemblyInfo.cs @@ -9,8 +9,8 @@ using System.Reflection; [assembly: AssemblyDescription("NotificationConfiguration is a part of the CoScInE group.")] [assembly: AssemblyCompany("IT Center, RWTH Aachen University")] [assembly: AssemblyProduct("NotificationConfiguration")] -[assembly: AssemblyVersion("1.3.0")] -[assembly: AssemblyFileVersion("1.3.0")] -[assembly: AssemblyInformationalVersion("1.3.0-topic-1062-pidpa0001")] +[assembly: AssemblyVersion("1.4.0")] +[assembly: AssemblyFileVersion("1.4.0")] +[assembly: AssemblyInformationalVersion("1.4.0-topic-1127-email0006")] [assembly: AssemblyCopyright("2020 IT Center, RWTH Aachen University")] diff --git a/src/NotificationConfiguration/partials/email/de/footer.tpl b/src/NotificationConfiguration/partials/email/de/footer.tpl new file mode 100644 index 0000000000000000000000000000000000000000..c9aced4d5e7f560d54d434f95580e82c163fcdc2 --- /dev/null +++ b/src/NotificationConfiguration/partials/email/de/footer.tpl @@ -0,0 +1,52 @@ + <p style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"><a href="https://coscine.rwth-aachen.de" class="btn btn-primary" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-decoration: none; padding: 10px 15px; display: inline-block; border-radius: 5px; background: #00549F; color: #ffffff;">Log In</a></p> + </div> + </td> + </tr> + </table> + </td> + </tr><!-- end tr --> + <!-- 1 Column Text + Button : END --> + </table> + <table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; table-layout: fixed; margin: 0 auto;"> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td valign="middle" class="bg_light footer email-section" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background: #fafafa; padding: 2.5em; border-top: 1px solid rgba(0,0,0,.05); color: rgba(0,0,0,.5); mso-table-lspace: 0pt; mso-table-rspace: 0pt;"> + <table style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; table-layout: fixed; margin: 0 auto;"> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td valign="top" width="50%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; padding-top: 20px; mso-table-lspace: 0pt; mso-table-rspace: 0pt;"> + <table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; table-layout: fixed; margin: 0 auto;"> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-align: left; padding-right: 10px; mso-table-lspace: 0pt; mso-table-rspace: 0pt;" align="left"> + <h3 class="heading" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; font-family: 'Lato', sans-serif; margin-top: 0; font-weight: 400; color: #000; font-size: 20px;">About</h3> + <p style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">Coscine is a research data platform hosted at RWTH Aachen University.</p> + </td> + </tr> + </table> + </td> + <td valign="top" width="50%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; padding-top: 20px; mso-table-lspace: 0pt; mso-table-rspace: 0pt;"> + <table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; table-layout: fixed; margin: 0 auto;"> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-align: right; padding-left: 5px; padding-right: 5px; mso-table-lspace: 0pt; mso-table-rspace: 0pt;" align="right"> + <h3 class="heading" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; font-family: 'Lato', sans-serif; margin-top: 0; font-weight: 400; color: #000; font-size: 20px;">Contact Info</h3> + <ul style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; margin: 0; padding: 0;"> + <li style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; list-style: none; margin-bottom: 10px;"><span class="text" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">IT Center of RWTH Aachen University</span></li> <li style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; list-style: none; margin-bottom: 10px;"> <a href="mailto:servicedesk@itc.rwth-aachen.de" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-decoration: none; color: rgba(0,0,0,1);">servicedesk@itc.rwth-aachen.de</a></li> + <li style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; list-style: none; margin-bottom: 10px;"><span class="text" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">+49 241 80 24687</span></li> + </ul> + </td> + </tr> + </table> + </td> + </tr> + </table> + </td> + </tr> + </table> + <!-- end: tr --> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td class="bg_light" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background: #fafafa; text-align: center; mso-table-lspace: 0pt; mso-table-rspace: 0pt;" align="center"> + <p style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">Coscine is currently in a pilot phase. If you encounter bugs or want to give general feedback you can do that <a href="https://git.rwth-aachen.de/coscine/docs/wiki" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-decoration: none; color: rgba(0,0,0,.8);">here.</a></p> + </td> + </tr> + </div> + </center> +</body> +</html> diff --git a/src/NotificationConfiguration/partials/email/de/header.tpl b/src/NotificationConfiguration/partials/email/de/header.tpl new file mode 100644 index 0000000000000000000000000000000000000000..e258864e2ea7220b0fbe8d3ce402af7e43a63ffd --- /dev/null +++ b/src/NotificationConfiguration/partials/email/de/header.tpl @@ -0,0 +1,58 @@ +<!DOCTYPE html> +<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background: #f1f1f1; margin: 0 auto; padding: 0; height: 100%; width: 100%;"> +<head> + <meta charset="utf-8"> <!-- utf-8 works for most cases --> + <meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary --> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine --> + <meta name="x-apple-disable-message-reformatting"> <!-- Disable auto-scale in iOS 10 Mail entirely --> + <title></title> <!-- The title tag shows in email notifications, like Android 4.4. --> + <!-- CSS Reset : BEGIN --> + <style> +@media only screen and (min-device-width: 320px) and (max-device-width: 374px) { + u ~ div .email-container { + min-width: 320px !important; + } +} +@media only screen and (min-device-width: 375px) and (max-device-width: 413px) { + u ~ div .email-container { + min-width: 375px !important; + } +} +@media only screen and (min-device-width: 414px) { + u ~ div .email-container { + min-width: 414px !important; + } +} +</style> + + <!-- CSS Reset : END --> + + <!-- Progressive Enhancements : BEGIN --> + <style> +@media screen and (max-width: 500px) {} +</style> +</head> +<body width="100%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background: #f1f1f1; font-family: 'Lato', sans-serif; font-weight: 400; font-size: 15px; line-height: 1.8; color: rgba(0,0,0,.4); mso-line-height-rule: exactly; background-color: #f1f1f1; margin: 0 auto; height: 100%; width: 100%; padding: 0;"> + <center style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; width: 100%; background-color: #f1f1f1;"> + <div style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; display: none; font-size: 1px; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden; mso-hide: all; font-family: sans-serif;"> + ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ + </div> + <div style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; max-width: 600px; margin: 0 auto;" class="email-container"> + <!-- BEGIN BODY --> + <table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; table-layout: fixed; margin: 0 auto;"> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td valign="top" class="bg_white" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background: #ffffff; padding: 1em 2.5em 0 2.5em; mso-table-lspace: 0pt; mso-table-rspace: 0pt;"> + <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; table-layout: fixed; margin: 0 auto;"> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td class="logo" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-align: center; mso-table-lspace: 0pt; mso-table-rspace: 0pt;" align="center"> + <h1 style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; font-family: 'Lato', sans-serif; color: #000000; margin-top: 0; font-weight: 400; margin: 0;"><a href="#" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-decoration: none; color: #00549F; font-size: 24px; font-weight: 700; font-family: 'Lato', sans-serif;">Coscine Notification</a></h1> + </td> + </tr> + </table> + </td> + </tr><tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td valign="middle" class="hero bg_white" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background: #ffffff; position: relative; z-index: 0; padding: 2em 0 4em 0; mso-table-lspace: 0pt; mso-table-rspace: 0pt;"> + <table style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; table-layout: fixed; margin: 0 auto;"> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt;"> + <div class="text" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: rgba(0,0,0,.3); padding: 0 2.5em; text-align: center;"> \ No newline at end of file diff --git a/src/NotificationConfiguration/partials/email/en/footer.tpl b/src/NotificationConfiguration/partials/email/en/footer.tpl new file mode 100644 index 0000000000000000000000000000000000000000..c9aced4d5e7f560d54d434f95580e82c163fcdc2 --- /dev/null +++ b/src/NotificationConfiguration/partials/email/en/footer.tpl @@ -0,0 +1,52 @@ + <p style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"><a href="https://coscine.rwth-aachen.de" class="btn btn-primary" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-decoration: none; padding: 10px 15px; display: inline-block; border-radius: 5px; background: #00549F; color: #ffffff;">Log In</a></p> + </div> + </td> + </tr> + </table> + </td> + </tr><!-- end tr --> + <!-- 1 Column Text + Button : END --> + </table> + <table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; table-layout: fixed; margin: 0 auto;"> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td valign="middle" class="bg_light footer email-section" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background: #fafafa; padding: 2.5em; border-top: 1px solid rgba(0,0,0,.05); color: rgba(0,0,0,.5); mso-table-lspace: 0pt; mso-table-rspace: 0pt;"> + <table style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; table-layout: fixed; margin: 0 auto;"> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td valign="top" width="50%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; padding-top: 20px; mso-table-lspace: 0pt; mso-table-rspace: 0pt;"> + <table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; table-layout: fixed; margin: 0 auto;"> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-align: left; padding-right: 10px; mso-table-lspace: 0pt; mso-table-rspace: 0pt;" align="left"> + <h3 class="heading" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; font-family: 'Lato', sans-serif; margin-top: 0; font-weight: 400; color: #000; font-size: 20px;">About</h3> + <p style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">Coscine is a research data platform hosted at RWTH Aachen University.</p> + </td> + </tr> + </table> + </td> + <td valign="top" width="50%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; padding-top: 20px; mso-table-lspace: 0pt; mso-table-rspace: 0pt;"> + <table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; table-layout: fixed; margin: 0 auto;"> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-align: right; padding-left: 5px; padding-right: 5px; mso-table-lspace: 0pt; mso-table-rspace: 0pt;" align="right"> + <h3 class="heading" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; font-family: 'Lato', sans-serif; margin-top: 0; font-weight: 400; color: #000; font-size: 20px;">Contact Info</h3> + <ul style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; margin: 0; padding: 0;"> + <li style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; list-style: none; margin-bottom: 10px;"><span class="text" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">IT Center of RWTH Aachen University</span></li> <li style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; list-style: none; margin-bottom: 10px;"> <a href="mailto:servicedesk@itc.rwth-aachen.de" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-decoration: none; color: rgba(0,0,0,1);">servicedesk@itc.rwth-aachen.de</a></li> + <li style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; list-style: none; margin-bottom: 10px;"><span class="text" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">+49 241 80 24687</span></li> + </ul> + </td> + </tr> + </table> + </td> + </tr> + </table> + </td> + </tr> + </table> + <!-- end: tr --> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td class="bg_light" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background: #fafafa; text-align: center; mso-table-lspace: 0pt; mso-table-rspace: 0pt;" align="center"> + <p style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">Coscine is currently in a pilot phase. If you encounter bugs or want to give general feedback you can do that <a href="https://git.rwth-aachen.de/coscine/docs/wiki" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-decoration: none; color: rgba(0,0,0,.8);">here.</a></p> + </td> + </tr> + </div> + </center> +</body> +</html> diff --git a/src/NotificationConfiguration/partials/email/en/header.tpl b/src/NotificationConfiguration/partials/email/en/header.tpl new file mode 100644 index 0000000000000000000000000000000000000000..e258864e2ea7220b0fbe8d3ce402af7e43a63ffd --- /dev/null +++ b/src/NotificationConfiguration/partials/email/en/header.tpl @@ -0,0 +1,58 @@ +<!DOCTYPE html> +<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background: #f1f1f1; margin: 0 auto; padding: 0; height: 100%; width: 100%;"> +<head> + <meta charset="utf-8"> <!-- utf-8 works for most cases --> + <meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary --> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine --> + <meta name="x-apple-disable-message-reformatting"> <!-- Disable auto-scale in iOS 10 Mail entirely --> + <title></title> <!-- The title tag shows in email notifications, like Android 4.4. --> + <!-- CSS Reset : BEGIN --> + <style> +@media only screen and (min-device-width: 320px) and (max-device-width: 374px) { + u ~ div .email-container { + min-width: 320px !important; + } +} +@media only screen and (min-device-width: 375px) and (max-device-width: 413px) { + u ~ div .email-container { + min-width: 375px !important; + } +} +@media only screen and (min-device-width: 414px) { + u ~ div .email-container { + min-width: 414px !important; + } +} +</style> + + <!-- CSS Reset : END --> + + <!-- Progressive Enhancements : BEGIN --> + <style> +@media screen and (max-width: 500px) {} +</style> +</head> +<body width="100%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background: #f1f1f1; font-family: 'Lato', sans-serif; font-weight: 400; font-size: 15px; line-height: 1.8; color: rgba(0,0,0,.4); mso-line-height-rule: exactly; background-color: #f1f1f1; margin: 0 auto; height: 100%; width: 100%; padding: 0;"> + <center style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; width: 100%; background-color: #f1f1f1;"> + <div style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; display: none; font-size: 1px; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden; mso-hide: all; font-family: sans-serif;"> + ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ + </div> + <div style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; max-width: 600px; margin: 0 auto;" class="email-container"> + <!-- BEGIN BODY --> + <table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; table-layout: fixed; margin: 0 auto;"> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td valign="top" class="bg_white" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background: #ffffff; padding: 1em 2.5em 0 2.5em; mso-table-lspace: 0pt; mso-table-rspace: 0pt;"> + <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; table-layout: fixed; margin: 0 auto;"> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td class="logo" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-align: center; mso-table-lspace: 0pt; mso-table-rspace: 0pt;" align="center"> + <h1 style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; font-family: 'Lato', sans-serif; color: #000000; margin-top: 0; font-weight: 400; margin: 0;"><a href="#" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-decoration: none; color: #00549F; font-size: 24px; font-weight: 700; font-family: 'Lato', sans-serif;">Coscine Notification</a></h1> + </td> + </tr> + </table> + </td> + </tr><tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td valign="middle" class="hero bg_white" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background: #ffffff; position: relative; z-index: 0; padding: 2em 0 4em 0; mso-table-lspace: 0pt; mso-table-rspace: 0pt;"> + <table style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; table-layout: fixed; margin: 0 auto;"> + <tr style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"> + <td style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt;"> + <div class="text" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: rgba(0,0,0,.3); padding: 0 2.5em; text-align: center;"> \ No newline at end of file