fix: apply brand changes (#27536)

## Description
apply branding changes to email verification template

Fixes #27528
Fixes #27431
Fixes #27475


#### Type of change
> Please delete options that are not relevant.
- Bug fix (non-breaking change which fixes an issue)

## Testing
>
#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [x] Manual
- [ ] JUnit
- [ ] Jest
- [ ] Cypress
>
>
#### Test Plan
> Add Testsmith test cases links that relate to this PR
>
>
#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
This commit is contained in:
Shubham Saxena 2023-09-21 18:43:39 +05:30 committed by GitHub
parent 18fcd09e07
commit 6bb6bc9754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 555 additions and 1009 deletions

View File

@ -24,7 +24,7 @@ public class EmailConstantsCE {
public static final String INVITE_WORKSPACE_TEMPLATE_NEW_USER_CE = "email/ce/inviteWorkspaceNewUserTemplate.html";
public static final String FORGOT_PASSWORD_TEMPLATE_CE = "email/ce/forgotPasswordTemplate.html";
public static final String INSTANCE_ADMIN_INVITE_EMAIL_TEMPLATE = "email/ce/instanceAdminInviteTemplate.html";
public static final String EMAIL_VERIFICATION_EMAIL_TEMPLATE = "email/emailVerificationTemplate.html";
public static final String EMAIL_VERIFICATION_EMAIL_TEMPLATE_CE = "email/ce/emailVerificationTemplate.html";
public static final String WORKSPACE_URL = "%s/applications#%s";
public static final String INVITER_FIRST_NAME = "inviterFirstName";
public static final String INVITER_WORKSPACE_NAME = "inviterWorkspaceName";

View File

@ -16,7 +16,7 @@ public interface EmailServiceCE {
String originHeader,
boolean isNewUser);
Mono<Boolean> sendEmailVerificationEmail(User user, String verificationUrl);
Mono<Boolean> sendEmailVerificationEmail(User user, String verificationUrl, String originHeader);
Mono<Boolean> sendInstanceAdminInviteEmail(
User invitedUser, User invitingUser, String originHeader, boolean isNewUser);

View File

@ -63,15 +63,16 @@ public class EmailServiceCEImpl implements EmailServiceCE {
}
@Override
public Mono<Boolean> sendEmailVerificationEmail(User user, String verificationURL) {
public Mono<Boolean> sendEmailVerificationEmail(User user, String verificationURL, String originHeader) {
Map<String, String> params = new HashMap<>();
params.put(EMAIL_VERIFICATION_URL, verificationURL);
return this.enrichParams(params)
.flatMap(updatedParams -> emailSender.sendMail(
user.getEmail(),
EMAIL_VERIFICATION_EMAIL_SUBJECT,
EMAIL_VERIFICATION_EMAIL_TEMPLATE,
updatedParams));
.flatMap(enrichedParams -> this.enrichWithBrandParams(enrichedParams, originHeader)
.flatMap(updatedParams -> emailSender.sendMail(
user.getEmail(),
EMAIL_VERIFICATION_EMAIL_SUBJECT,
getEmailVerificationTemplate(),
updatedParams)));
}
@Override
@ -123,6 +124,10 @@ public class EmailServiceCEImpl implements EmailServiceCE {
return INVITE_WORKSPACE_TEMPLATE_EXISTING_USER_CE;
}
protected String getEmailVerificationTemplate() {
return EMAIL_VERIFICATION_EMAIL_TEMPLATE_CE;
}
protected String getAdminInstanceInviteTemplate() {
return INSTANCE_ADMIN_INVITE_EMAIL_TEMPLATE;
}

View File

@ -850,7 +850,8 @@ public class UserServiceCEImpl extends BaseService<UserRepository, User, String>
URLEncoder.encode(emailVerificationToken.getEmail(), StandardCharsets.UTF_8),
redirectUrlCopy);
return emailService.sendEmailVerificationEmail(user, verificationUrl);
return emailService.sendEmailVerificationEmail(
user, verificationUrl, resendEmailVerificationDTO.getBaseUrl());
})
.thenReturn(true);
}

View File

@ -0,0 +1,540 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Verify your email for {{instanceName}}</title>
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!--<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
#outlook a {
padding: 0;
}
body {
margin: 0;
padding: 0;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
table,
td {
border-collapse: collapse;
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
border: 0;
height: auto;
line-height: 100%;
outline: none;
text-decoration: none;
-ms-interpolation-mode: bicubic;
}
p {
display: block;
margin: 0;
}
</style>
<!--[if mso]>
<noscript
><xml
><o:OfficeDocumentSettings
><o:AllowPNG /><o:PixelsPerInch
>96</o:PixelsPerInch
></o:OfficeDocumentSettings
></xml
></noscript
>
<![endif]-->
<!--[if lte mso 11]>
<style type="text/css">
.ogf {
width: 100% !important;
}
</style>
<![endif]-->
<!--[if !mso]><!-->
<link
href="https://fonts.googleapis.com/css?family=Inter:700"
rel="stylesheet"
type="text/css"
/>
<style type="text/css"></style>
<!--<![endif]-->
<style type="text/css">
@media only screen and (min-width: 599px) {
.xc536 {
width: 536px !important;
max-width: 536px;
}
.xc0 {
width: 0px !important;
max-width: 0;
}
.xc16 {
width: 16px !important;
max-width: 16px;
}
}
</style>
<style media="screen and (min-width:599px)">
.moz-text-html .xc536 {
width: 536px !important;
max-width: 536px;
}
.moz-text-html .xc0 {
width: 0px !important;
max-width: 0;
}
.moz-text-html .xc16 {
width: 16px !important;
max-width: 16px;
}
</style>
<style type="text/css">
@media only screen and (max-width: 599px) {
table.fwm {
width: 100% !important;
}
td.fwm {
width: auto !important;
}
}
</style>
<style type="text/css">
u + .emailify a,
#MessageViewBody a,
a[x-apple-data-detectors] {
color: inherit !important;
text-decoration: none !important;
font-size: inherit !important;
font-family: inherit !important;
font-weight: inherit !important;
line-height: inherit !important;
}
span.MsoHyperlink {
mso-style-priority: 99;
color: inherit;
}
span.MsoHyperlinkFollowed {
mso-style-priority: 99;
color: inherit;
}
td.b .klaviyo-image-block {
display: inline;
vertical-align: middle;
}
@media only screen and (max-width: 599px) {
.emailify {
height: 100% !important;
margin: 0 !important;
padding: 0 !important;
width: 100% !important;
}
u + .emailify .glist {
margin-left: 1em !important;
}
td.x {
padding-left: 0 !important;
padding-right: 0 !important;
}
.fwm img {
max-width: 100% !important;
height: auto !important;
}
td.b.nw > table,
td.b.nw a {
width: auto !important;
}
td.stk {
border: 0 !important;
}
br.sb {
display: none !important;
}
.thd-1 .i-thumbnail {
display: inline-block !important;
height: auto !important;
overflow: hidden !important;
}
.hd-1 {
display: block !important;
height: auto !important;
overflow: visible !important;
}
.ht-1 {
display: table !important;
height: auto !important;
overflow: visible !important;
}
.hr-1 {
display: table-row !important;
height: auto !important;
overflow: visible !important;
}
.hc-1 {
display: table-cell !important;
height: auto !important;
overflow: visible !important;
}
div.r.pr-16 > table > tbody > tr > td,
div.r.pr-16 > div > table > tbody > tr > td {
padding-right: 16px !important;
}
div.r.pl-16 > table > tbody > tr > td,
div.r.pl-16 > div > table > tbody > tr > td {
padding-left: 16px !important;
}
td.b.fw-1 > table {
width: 100% !important;
}
td.fw-1 > table > tbody > tr > td > a {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
}
td.b.fw-1 > table {
width: 100% !important;
}
td.fw-1 > table > tbody > tr > td {
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
}
}
</style>
<meta name="color-scheme" content="light dark" />
<meta name="supported-color-schemes" content="light dark" />
<!--[if gte mso 9]>
<style>
li {
text-indent: -1em;
}
</style>
<![endif]-->
</head>
<body
lang="en"
class="emailify"
style="
mso-line-height-rule: exactly;
word-spacing: normal;
background-color: #d6d6d6;
"
>
<div class="bg" style="background-color: #d6d6d6">
<!--[if mso | IE]>
<table align="left" border="0" cellpadding="0" cellspacing="0" class="r-outlook -outlook pr-16-outlook pl-16-outlook -outlook" role="none" style="width:600px;" width="600" bgcolor="#f8f8f8"><tr><td style="line-height:0;font-size:0;mso-line-height-rule:exactly;">
<![endif]-->
<div
class="r pr-16 pl-16"
style="background-color: #f8f8f8; margin: 0px auto"
>
<table
align="left"
border="0"
cellpadding="0"
cellspacing="0"
role="none"
style="background-color: #f8f8f8; width: 100%"
>
<tbody>
<tr>
<td
style="
border: none;
direction: ltr;
font-size: 0;
padding: 32px 32px 32px 32px;
text-align: center;
"
>
<div
class="xc536 ogf c"
style="
font-size: 0;
text-align: left;
direction: ltr;
display: inline-block;
vertical-align: top;
width: 100%;
"
>
<table
border="0"
cellpadding="0"
cellspacing="0"
role="none"
style="border-collapse: separate"
width="600"
>
<tbody>
<tr>
<td
style="
background-color: #ffffff;
border: 1px solid #f1f1f1;
border-radius: 4px;
vertical-align: middle;
padding: 40px 40px;
"
>
<table
border="0"
cellpadding="0"
cellspacing="0"
role="none"
width="100%"
>
<tbody>
<tr>
<td
align="left"
class="i m"
style="
font-size: 0;
padding: 0;
padding-bottom: 24px;
word-break: break-word;
border-bottom: 1px solid #cdd5df;
"
>
<table
border="0"
cellpadding="0"
cellspacing="0"
role="none"
style="
border-collapse: collapse;
border-spacing: 0;
"
>
<tbody>
<tr>
<td>
<img
alt=""
height="36"
src="https://assets.appsmith.com/appsmith-logo-no-margin.png"
style="
border: 0;
display: block;
outline: none;
text-decoration: none;
height: 36px;
width: auto;
"
title=""
width="200"
/>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td
align="left"
class="x m"
style="
font-size: 0;
padding-top: 24px;
padding-bottom: 16px;
word-break: break-word;
"
>
<div style="text-align: left">
<p style="margin: 0; text-align: left">
<span
style="
font-size: 14px;
font-family: SF Pro Text, Arial,
sans-serif;
color: #4c5664;
line-height: 1.43;
font-weight: 500;
"
>
Hey,
</span>
</p>
</div>
</td>
</tr>
<tr>
<td
align="left"
class="x m"
style="
font-size: 0;
padding-bottom: 16px;
word-break: break-word;
"
>
<div style="text-align: left">
<p style="margin: 0; text-align: left">
<span
style="
font-size: 14px;
font-family: SF Pro Text, Arial,
sans-serif;
color: #4c5664;
line-height: 1.43;
"
>Thank you for signing up! Before we get started, we just need to confirm that this is you. Click below to verify your email address.</span
>
</p>
</div>
</td>
</tr>
<tr>
<td
align="left"
class="x m"
style="
font-size: 0;
padding-bottom: 24px;
word-break: break-word;
"
>
<div style="text-align: left">
<p style="margin: 0; text-align: left">
<span
style="
font-size: 12px;
font-family: SF Pro Text, Arial,
sans-serif;
color: #6a7585;
line-height: 1.43;
"
>The link expires in two days&rsquo;
time. Better not wait.</span
>
</p>
</div>
</td>
</tr>
<tr>
<td
align="left"
class="b fw-1"
style="
font-size: 0;
padding: 0;
padding-bottom: 24px;
word-break: break-word;
border-bottom: 1px solid #cdd5df;
"
>
<table
border="0"
cellpadding="0"
cellspacing="0"
role="none"
style="
border-collapse: separate;
line-height: 100%;
"
>
<tbody>
<tr>
<td
align="center"
bgcolor="#f86a2b"
role="none"
style="
border: none;
border-radius: 4px 4px 4px 4px;
cursor: auto;
mso-padding-alt: 12px 0px 12px 0px;
background: #f86a2b;
"
valign="middle"
>
<a
href="{{verificationUrl}}"
style="
display: inline-block;
background: #f86a2b;
color: #ffffff;
font-family: SF Pro Text, Arial,
sans-serif;
font-size: 14px;
font-weight: normal;
line-height: 100%;
margin: 0;
text-decoration: none;
text-transform: none;
padding: 12px 12px 12px 12px;
mso-padding-alt: 0;
border-radius: 4px 4px 4px 4px;
"
target="_blank"
>
<span
style="
font-size: 14px;
font-family: SF Pro Text, Arial,
sans-serif;
color: #ffffff;
line-height: 1.43;
"
>Verify</span
></a
>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td
align="left"
class="x m"
style="
font-size: 0;
padding-top: 24px;
word-break: break-word;
"
>
<div style="text-align: left">
<p style="margin: 0; text-align: left">
<span
style="
font-size: 12px;
font-family: SF Pro Text, Arial,
sans-serif;
font-weight: 400;
color: #6a7585;
line-height: 1.43;
"
>1390, Market Street, Suite 200, San
Francisco, California 94102, United
States</span
>
</p>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td></tr></table>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>