Skip to content

Commit

Permalink
satellite/console: add activation failure account lock email
Browse files Browse the repository at this point in the history
add new email for account locking for account activation failure.

Change-Id: Iaf50f220f13a5b8c59b9538bd9bb0af28b6224c6
  • Loading branch information
cam-a authored and Storj Robot committed Mar 21, 2024
1 parent db9bf03 commit bbccdb5
Show file tree
Hide file tree
Showing 4 changed files with 294 additions and 5 deletions.
20 changes: 16 additions & 4 deletions satellite/console/mail.go
Expand Up @@ -174,14 +174,26 @@ func (*AccountAlreadyExistsEmail) Subject() string {
return "Are you trying to sign in?"
}

// LockAccountEmail is mailservice template with lock account data.
type LockAccountEmail struct {
// LoginLockAccountEmail is mailservice template with login lock account data.
type LoginLockAccountEmail struct {
LockoutDuration time.Duration
ResetPasswordLink string
}

// Template returns email template name.
func (*LockAccountEmail) Template() string { return "LockAccount" }
func (*LoginLockAccountEmail) Template() string { return "LoginLockAccount" }

// Subject gets email subject.
func (*LockAccountEmail) Subject() string { return "Account Lock" }
func (*LoginLockAccountEmail) Subject() string { return "Account Lock" }

// ActivationLockAccountEmail is mailservice template with activation lock account data.
type ActivationLockAccountEmail struct {
LockoutDuration time.Duration
SupportURL string
}

// Template returns email template name.
func (*ActivationLockAccountEmail) Template() string { return "ActivationLockAccount" }

// Subject gets email subject.
func (*ActivationLockAccountEmail) Subject() string { return "Account Lock" }
2 changes: 1 addition & 1 deletion satellite/console/service.go
Expand Up @@ -1442,7 +1442,7 @@ func (s *Service) UpdateUsersFailedLoginState(ctx context.Context, user *User) (
s.mailService.SendRenderedAsync(
ctx,
[]post.Address{{Address: user.Email, Name: user.FullName}},
&LockAccountEmail{
&LoginLockAccountEmail{
LockoutDuration: lockoutDuration,
ResetPasswordLink: address + "forgot-password",
},
Expand Down
277 changes: 277 additions & 0 deletions web/satellite/static/emails/ActivationLockAccount.html
@@ -0,0 +1,277 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office">

<head>
<!--[if gte mso 9]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings></xml>
<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--<![endif]-->
<title></title>
<style type="text/css">
body {
margin: 0;
padding: 0;
}

table,
td,
tr {
vertical-align: top;
border-collapse: collapse;
}

* {
line-height: inherit;
}

a[x-apple-data-detectors=true] {
color: inherit !important;
text-decoration: none !important;
}

.im {
color: #56606D;
}
</style>
<style type="text/css" id="media-query">
@media (max-width: 540px) {

.block-grid,
.col {
min-width: 320px !important;
max-width: 100% !important;
display: block !important;
}

.block-grid {
width: 100% !important;
}

.col {
width: 100% !important;
}

.col>div {
margin: 0 auto;
}

.no-stack .col {
min-width: 0 !important;
display: table-cell !important;
}

.no-stack.two-up .col {
width: 50% !important;
}

.no-stack .col.num4 {
width: 33% !important;
}

.no-stack .col.num8 {
width: 66% !important;
}

.no-stack .col.num4 {
width: 33% !important;
}

.no-stack .col.num3 {
width: 25% !important;
}

.no-stack .col.num6 {
width: 50% !important;
}

.no-stack .col.num9 {
width: 75% !important;
}
}
</style>
</head>

<body class="clean-body" style="margin: 0; padding: 0; -webkit-text-size-adjust: 100%; background-color: #FFFFFF;">
<!--[if IE]><div class="ie-browser"><![endif]-->
<table class="nl-container" style="table-layout: fixed; vertical-align: top; min-width: 320px; Margin: 0 auto; border-spacing: 0;
border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; background-color: #FFFFFF; width: 100%;"
cellpadding="0" cellspacing="0" role="presentation" width="100%" bgcolor="#FFFFFF" valign="top">
<tbody>
<tr style="vertical-align: top;" valign="top">
<td style="word-break: break-word; vertical-align: top;" valign="top">
<!--[if (mso)|(IE)]>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="center" style="background-color:#FFFFFF">
<![endif]-->
<div style="background-color: #FFFFFF;">
<div class="block-grid " style="Margin: 0 auto; min-width: 320px; max-width: 520px; overflow-wrap: break-word;
word-wrap: break-word; word-break: break-word; background-color: #FFFFFF;">
<div
style="border-collapse: collapse;display: table;width: 100%;background-color: #FFFFFF;">
<!--[if (mso)|(IE)]>
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="background-color:#FFFFFF;">
<tr><td align="center">
<table cellpadding="0" cellspacing="0" border="0" style="width:520px">
<tr class="layout-full-width" style="background-color:#FFFFFF">
<![endif]-->
<!--[if (mso)|(IE)]>
<td align="center" width="520" style="background-color:#FFFFFF;width:520px;
border-top: 0px solid #000000; border-left: 0px solid #000000;
border-bottom: 0px solid #000000; border-right: 0px solid #000000;" valign="top">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td style="padding:10px 15px 0 15px;background-color:#FFFFFF;">
<![endif]-->
<div class="col num12"
style="min-width: 320px; max-width: 520px; display: table-cell; vertical-align: top; width: 520px;">
<div style="background-color: #FFFFFF;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!-->
<div style="border-top: 0px solid #000000; border-left: 0px solid #000000;
border-bottom: 0px solid #000000; border-right: 0px solid #000000; padding: 10px;">
<!--<![endif]-->
<div>
<h1 style="font-family: Helvetica, sans-serif; text-align: left;
color: #000; font-weight: 800; font-size: 36px; line-height: 47px;">
Your account was locked...
</h1>
</div>
<!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td style="padding: 10px 10px 0 10px;font-family: Helvetica, sans-serif; font-weight:300;">
<![endif]-->
<div style="color: #000000;font-family: Helvetica, sans-serif; font-weight: 300;
line-height: 1.2;">
<div
style="font-family: Helvetica, sans-serif; font-weight: 300; line-height: 1.2; font-size: 12px; color: #000000; mso-line-height-alt: 14px;">
<p
style="color: #56606D; font-size: 16px; line-height: 24px; margin: 0 0 15px 0;">
Hi,<br /><br />
Your account was locked due to too many failed activation
attempts.
<br /><br />
You should have received an email with a 6 digit activation
code. Use
this to activate your account.
<br /><br />
If this was you, try again in {{ .LockoutDuration }}, or <a
href="{{ .SupportURL }}">contact support</a> if you need
assistance.
</p>
<p
style="color: #56606D; font-size: 16px; line-height: 24px; margin: 25px 0 0 0;">
If this activity doesn't look familiar, please activate your
account right away and consider
enabling multi-factor authentication in account settings after
accessing your account.
</p>
</div>
</div>
<!--[if mso]></td></tr></table><![endif]-->
<!--[if (!mso)&(!IE)]><!-->
</div>
<!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td></tr></table><![endif]-->
<!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<div style="background-color: transparent;">
<div class="block-grid " style="Margin: 0 auto; min-width: 320px; max-width: 520px; overflow-wrap: break-word;
word-wrap: break-word; word-break: break-word; background-color: transparent;">
<div
style="border-collapse: collapse;display: table;width: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]>
<table width="100%" cellpadding="0" cellspacing="0" border="0"
style="background-color:transparent;">
<tr><td align="center">
<table cellpadding="0" cellspacing="0" border="0" style="width:520px">
<tr class="layout-full-width" style="background-color:transparent">
<![endif]-->
<!--[if (mso)|(IE)]>
<td align="center"
style="background-color:transparent;width:520px; border-top: 0px solid transparent;
border-left: 0px solid transparent; border-bottom: 0px solid transparent;
border-right: 0px solid transparent;" valign="top">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td style="padding:20px 0 5px 0">
<![endif]-->
<div class="col num12" style="min-width: 320px; max-width: 520px; display: table-cell;
vertical-align: top; width: 520px;padding: 10px;">
<div style="width: 100% !important;">
<!--[if (!mso)&(!IE)]><!-->
<div style="border-top: 0px solid transparent; border-left: 0px solid transparent;
border-bottom: 0px solid transparent; border-right: 0px solid transparent;
padding: 0 0 5px 0;">
<!--<![endif]-->
<table class="divider" border="0" cellpadding="0" cellspacing="0"
width="100%" style="table-layout: fixed; vertical-align: top; border-spacing: 0;
border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt;
min-width: 100%; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"
role="presentation" valign="top">
<tbody>
<tr style="vertical-align: top;" valign="top">
<td class="divider_inner" style="word-break: break-word; vertical-align: top;
min-width: 100%; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;
padding: 10px 0 40px 0;" valign="top">
<table class="divider_content" border="0" cellpadding="0"
cellspacing="0" width="100%" style="table-layout: fixed; vertical-align: top;
border-spacing: 0; border-collapse: collapse; mso-table-lspace: 0pt;
mso-table-rspace: 0pt; border-top: 1px solid #BBBBBB; height: 0px;
width: 100%;" align="center" role="presentation" height="0"
valign="top">
<tbody>
<tr style="vertical-align: top;" valign="top">
<td style="word-break: break-word; vertical-align: top;
-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;"
height="0" valign="top">
<span></span>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p class="size-12" style="margin: 0; color: #56606D;
font-family: Helvetica, sans-serif; font-weight: 300; font-size: 12px;
line-height: 19px;" lang="x-size-12">
<span>Please do not reply to this email.<br />
1450 W. Peachtree St. NW #200, PMB 75268, Atlanta, GA 30309-2955,
United States
</span>
</p>
<!--[if mso]>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td style="padding:10px; font-family: Helvetica, sans-serif; font-weight:300;">
<![endif]-->
<!--[if mso]></td></tr></table><![endif]-->
<!--[if (!mso)&(!IE)]><!-->
</div>
<!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td></tr></table><![endif]-->
<!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--[if (mso)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
<!--[if (IE)]></div><![endif]-->
</body>

</html>

0 comments on commit bbccdb5

Please sign in to comment.