You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openmeetings.apache.org by "solomax (via GitHub)" <gi...@apache.org> on 2023/05/12 07:38:00 UTC

[GitHub] [openmeetings] solomax commented on a diff in pull request #189: fixed #188 - [OPENMEETINGS-2774] Improve the mails (template) design

solomax commented on code in PR #189:
URL: https://github.com/apache/openmeetings/pull/189#discussion_r1192003392


##########
openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/InvitationTemplate.html:
##########
@@ -16,20 +16,172 @@
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
-
 -->
 <!DOCTYPE html>
 <html xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-9.xsd">
+
+<head>
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <style>
+    @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500&display=swap');

Review Comment:
   Please avoid using external resources



##########
openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/InvitationTemplate.html:
##########
@@ -16,20 +16,172 @@
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
-
 -->
 <!DOCTYPE html>
 <html xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-9.xsd">
+
+<head>
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <style>
+    @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500&display=swap');
+
+    @media only screen and (max-width: 620px) {
+      table.body h1 {
+        font-size: 28px !important;
+        margin-bottom: 10px !important;
+      }
+
+      table.body p,
+      table.body td,
+      table.body span,
+      table.body a {
+        font-size: 16px !important;
+      }
+
+      table.body .wrapper,
+      table.body .article {
+        padding: 10px !important;
+      }
+
+      table.body .content {
+        padding: 0 !important;
+      }
+
+      table.body .container {
+        padding: 0 !important;
+        width: 100% !important;
+      }
+
+      table.body .main {
+        border-left-width: 0 !important;
+        border-radius: 0 !important;
+        border-right-width: 0 !important;
+      }
+
+      table.body .btn table {
+        width: 100% !important;
+      }
+
+      table.body .btn a {
+        width: 100% !important;
+      }
+
+    }
+
+    @mwedia all {
+      body {
+        background-color: #f6f6f6;
+        font-family: sans-serif;
+        -webkit-font-smoothing: antialiased;
+        font-size: 14px;
+        line-height: 1.4;
+        margin: 0;
+        padding: 0;
+        -ms-text-size-adjust: 100%;
+        -webkit-text-size-adjust: 100%;
+        font-family: 'Montserrat', sans-serif;
+        font-size: 14px;
+      }
+
+    }
+  </style>
+</head>
+
 <wicket:extend>
-	<strong><span wicket:id="titleLbl"></span></strong><br />
-	<span wicket:id="userLbl"></span> <span wicket:id="user"></span><br/>
-	<span wicket:id="messageLbl"></span> <span wicket:id="message"></span><br/>
-	<div wicket:id="links">
-		<span wicket:id="comment_for_link1"></span><br/>
-		<a wicket:id="invitation_link1"><span wicket:id="clickMe"></span></a><br/>
-		<br/><br/>
-		<span wicket:id="comment_for_link2"></span><br/>
-		<span wicket:id="invitation_link2"></span>
-	</div>
+
+  <table role="presentation" border="0" cellpadding="0" cellspacing="0" class="body" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #f6f6f6; width: 100%;" width="100%" bgcolor="#f6f6f6">

Review Comment:
   inline styling should be avoided, it will fail in case CSP will be enabled



##########
openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/InvitationTemplate.html:
##########
@@ -16,20 +16,172 @@
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
-
 -->
 <!DOCTYPE html>
 <html xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-9.xsd">
+
+<head>
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <style>
+    @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500&display=swap');
+
+    @media only screen and (max-width: 620px) {
+      table.body h1 {
+        font-size: 28px !important;
+        margin-bottom: 10px !important;
+      }
+
+      table.body p,
+      table.body td,
+      table.body span,
+      table.body a {
+        font-size: 16px !important;
+      }
+
+      table.body .wrapper,
+      table.body .article {
+        padding: 10px !important;
+      }
+
+      table.body .content {
+        padding: 0 !important;
+      }
+
+      table.body .container {
+        padding: 0 !important;
+        width: 100% !important;
+      }
+
+      table.body .main {
+        border-left-width: 0 !important;
+        border-radius: 0 !important;
+        border-right-width: 0 !important;
+      }
+
+      table.body .btn table {
+        width: 100% !important;
+      }
+
+      table.body .btn a {
+        width: 100% !important;
+      }
+
+    }
+
+    @mwedia all {
+      body {
+        background-color: #f6f6f6;
+        font-family: sans-serif;
+        -webkit-font-smoothing: antialiased;
+        font-size: 14px;
+        line-height: 1.4;
+        margin: 0;
+        padding: 0;
+        -ms-text-size-adjust: 100%;
+        -webkit-text-size-adjust: 100%;
+        font-family: 'Montserrat', sans-serif;
+        font-size: 14px;
+      }
+
+    }
+  </style>
+</head>
+
 <wicket:extend>
-	<strong><span wicket:id="titleLbl"></span></strong><br />
-	<span wicket:id="userLbl"></span> <span wicket:id="user"></span><br/>
-	<span wicket:id="messageLbl"></span> <span wicket:id="message"></span><br/>
-	<div wicket:id="links">
-		<span wicket:id="comment_for_link1"></span><br/>
-		<a wicket:id="invitation_link1"><span wicket:id="clickMe"></span></a><br/>
-		<br/><br/>
-		<span wicket:id="comment_for_link2"></span><br/>
-		<span wicket:id="invitation_link2"></span>
-	</div>
+
+  <table role="presentation" border="0" cellpadding="0" cellspacing="0" class="body" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #f6f6f6; width: 100%;" width="100%" bgcolor="#f6f6f6">
+      <tr>
+          <td style="font-family: 'Montserrat', sans-serif; font-size: 14px; vertical-align: top;" valign="top">&nbsp;</td>
+          <td class="container" style="font-family: 'Montserrat', sans-serif; font-size: 14px; vertical-align: top; display: block; max-width: 580px; padding: 10px; width: 580px; margin: 0 auto;" width="580" valign="top">
+              <div class="content" style="box-sizing: border-box; display: block; margin: 0 auto; max-width: 580px; padding: 10px;">
+                  <!-- START CONTAINER -->
+                  <table role="presentation" class="main" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background: #ffffff; border-radius: 3px; width: 100%;" width="100%">
+                      <!-- START MAIN MSG -->
+                      <tr>
+                          <td class="wrapper" style="font-family: 'Montserrat', sans-serif; font-size: 14px; vertical-align: top; box-sizing: border-box; padding: 20px;" valign="top">
+                              <table role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" width="100%">
+                                  <tr>
+                                      <td style="font-family: 'Montserrat', sans-serif; font-size: 14px; vertical-align: top;" valign="top">
+                                        <!-- INVITATION LABEL -->
+                                          <span wicket:id="titleLbl" style="font-family: 'Montserrat', sans-serif; font-size: 20px; font-weight: normal; margin: 0; margin-bottom: 15px;"></span>
+                                          <!-- END INVITATION LABEL -->
+                                          <br /><br />
+                                          <!-- INVITATION MSG -->
+                                          <!-- <span wicket:id="titleLbl" style="font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: bold; margin: 0; margin-bottom: 20px;"></span><br /><br /> -->
+                                          <span wicket:id="userLbl"></span> <span wicket:id="user"></span><br/>
+                                          <span wicket:id="messageLbl"></span> <span wicket:id="message"></span><br/>
+                                          <!-- END INVITATION MSG -->
+                                          <br />
+                                          <table
+                                              role="presentation"
+                                              border="0"
+                                              cellpadding="0"
+                                              cellspacing="0"
+                                              class="btn btn-primary"
+                                              style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; box-sizing: border-box; width: 100%;"
+                                              width="100%"
+                                          >
+                                              <tbody>
+                                                  <tr>
+                                                      <td align="left" style="font-family: 'Montserrat', sans-serif; font-size: 14px; vertical-align: top; padding-bottom: 15px;" valign="top">

Review Comment:
   would it work for RTL languages?



##########
openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/InvitationTemplate.html:
##########
@@ -16,20 +16,172 @@
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
-
 -->
 <!DOCTYPE html>
 <html xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-9.xsd">
+
+<head>
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <style>
+    @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500&display=swap');
+
+    @media only screen and (max-width: 620px) {
+      table.body h1 {
+        font-size: 28px !important;
+        margin-bottom: 10px !important;
+      }
+
+      table.body p,
+      table.body td,
+      table.body span,
+      table.body a {
+        font-size: 16px !important;
+      }
+
+      table.body .wrapper,
+      table.body .article {
+        padding: 10px !important;
+      }
+
+      table.body .content {
+        padding: 0 !important;
+      }
+
+      table.body .container {
+        padding: 0 !important;
+        width: 100% !important;
+      }
+
+      table.body .main {
+        border-left-width: 0 !important;
+        border-radius: 0 !important;
+        border-right-width: 0 !important;
+      }
+
+      table.body .btn table {
+        width: 100% !important;
+      }
+
+      table.body .btn a {
+        width: 100% !important;
+      }
+
+    }
+
+    @mwedia all {
+      body {
+        background-color: #f6f6f6;
+        font-family: sans-serif;
+        -webkit-font-smoothing: antialiased;
+        font-size: 14px;
+        line-height: 1.4;
+        margin: 0;
+        padding: 0;
+        -ms-text-size-adjust: 100%;
+        -webkit-text-size-adjust: 100%;
+        font-family: 'Montserrat', sans-serif;
+        font-size: 14px;
+      }
+
+    }
+  </style>
+</head>
+
 <wicket:extend>
-	<strong><span wicket:id="titleLbl"></span></strong><br />
-	<span wicket:id="userLbl"></span> <span wicket:id="user"></span><br/>
-	<span wicket:id="messageLbl"></span> <span wicket:id="message"></span><br/>
-	<div wicket:id="links">
-		<span wicket:id="comment_for_link1"></span><br/>
-		<a wicket:id="invitation_link1"><span wicket:id="clickMe"></span></a><br/>
-		<br/><br/>
-		<span wicket:id="comment_for_link2"></span><br/>
-		<span wicket:id="invitation_link2"></span>
-	</div>
+
+  <table role="presentation" border="0" cellpadding="0" cellspacing="0" class="body" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #f6f6f6; width: 100%;" width="100%" bgcolor="#f6f6f6">
+      <tr>
+          <td style="font-family: 'Montserrat', sans-serif; font-size: 14px; vertical-align: top;" valign="top">&nbsp;</td>
+          <td class="container" style="font-family: 'Montserrat', sans-serif; font-size: 14px; vertical-align: top; display: block; max-width: 580px; padding: 10px; width: 580px; margin: 0 auto;" width="580" valign="top">
+              <div class="content" style="box-sizing: border-box; display: block; margin: 0 auto; max-width: 580px; padding: 10px;">
+                  <!-- START CONTAINER -->
+                  <table role="presentation" class="main" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background: #ffffff; border-radius: 3px; width: 100%;" width="100%">
+                      <!-- START MAIN MSG -->
+                      <tr>
+                          <td class="wrapper" style="font-family: 'Montserrat', sans-serif; font-size: 14px; vertical-align: top; box-sizing: border-box; padding: 20px;" valign="top">
+                              <table role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" width="100%">
+                                  <tr>
+                                      <td style="font-family: 'Montserrat', sans-serif; font-size: 14px; vertical-align: top;" valign="top">
+                                        <!-- INVITATION LABEL -->
+                                          <span wicket:id="titleLbl" style="font-family: 'Montserrat', sans-serif; font-size: 20px; font-weight: normal; margin: 0; margin-bottom: 15px;"></span>
+                                          <!-- END INVITATION LABEL -->
+                                          <br /><br />
+                                          <!-- INVITATION MSG -->
+                                          <!-- <span wicket:id="titleLbl" style="font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: bold; margin: 0; margin-bottom: 20px;"></span><br /><br /> -->

Review Comment:
   commented code should be removed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@openmeetings.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org