Updated unsubscribe page

No issue
This commit is contained in:
Sanne de Vries 2022-03-10 10:39:20 +00:00
parent 3bcb442811
commit 3d136c964d
4 changed files with 98 additions and 50 deletions

View File

@ -663,7 +663,7 @@ h2 {
flex-shrink: 0; flex-shrink: 0;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin: 0 5%; margin: 0 24px;
padding-bottom: 8vh; padding-bottom: 8vh;
} }
@ -679,15 +679,12 @@ h2 {
max-width: 520px; max-width: 520px;
width: 100%; width: 100%;
margin: 4rem 0 6rem; margin: 4rem 0 6rem;
padding: 40px;
background: #fff;
color: var(--darkgrey); color: var(--darkgrey);
font-size: 1.9rem; font-size: 1.9rem;
line-height: 1.5em; line-height: 1.5em;
font-weight: 300; font-weight: 300;
}
.gh-flow-content.private {
padding: 40px;
background: #fff;
border-radius: 3px; border-radius: 3px;
box-shadow: box-shadow:
0 2.8px 2.2px rgba(0,0,0,.02), 0 2.8px 2.2px rgba(0,0,0,.02),
@ -698,9 +695,20 @@ h2 {
0 100px 80px rgba(0,0,0,.05); 0 100px 80px rgba(0,0,0,.05);
} }
@media (max-width: 400px) { .gh-flow-content.unsubscribe {
align-items: center;
justify-content: center;
max-width: 560px;
min-height: 200;
margin: 4rem 0;
text-align: center;
}
@media (max-width: 500px) {
.gh-flow-content { .gh-flow-content {
font-size: 4vw; padding: 0;
background: transparent;
box-shadow: none;
} }
} }
@ -711,16 +719,34 @@ h2 {
} }
.gh-flow-content h1 { .gh-flow-content h1 {
margin-bottom: 32px; margin-bottom: 24px;
color: #15171A; color: #15171A;
font-size: 4.1rem; font-size: 4.1rem;
font-weight: 700; font-weight: 700;
line-height: 1.15em; line-height: 1.15em;
} }
.gh-flow-content.unsubscribe h1 {
font-size: 3.2rem;
}
@media (max-width: 600px) { @media (max-width: 600px) {
.gh-flow-content h1 { .gh-flow-content h1,
font-size: 7vw; .gh-flow-content.unsubscribe h1 {
font-size: 6vw;
}
}
.gh-flow-content.unsubscribe p {
margin: 0 0 .4em;
color: #394047;
font-size: 1.8rem;
}
@media (max-width: 500px) {
.gh-flow-content.unsubscribe p {
font-size: 1.6rem;
line-height: 1.5;
} }
} }
@ -755,6 +781,33 @@ h2 {
font-weight: 500; font-weight: 500;
} }
.unsubscribe-footer {
text-align: center;
font-size: 1.5rem;
}
@media (max-width: 500px) {
.unsubscribe-footer {
padding: 0 24px;
font-size: 1.4rem;
line-height: 1.4em;
}
}
.unsubscribe-footer p {
color: #7C8B9A;
margin: 0 0 .4rem;
}
.unsubscribe-footer a {
color: #15171A;
text-decoration: none;
}
.unsubscribe-footer a:hover {
text-decoration: underline;
}
/* Sign in /* Sign in
/* ---------------------------------------------------------- */ /* ---------------------------------------------------------- */
.gh-signin { .gh-signin {

View File

@ -5,8 +5,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<title> <title>
{{#if member}}Successfully Unsubscribed{{/if}} {{#if error}}
{{#if error}}Unsubscribe Failed{{/if}} Unsubscribe Failed
{{else}}
Successfully Unsubscribed
{{/if}}
</title> </title>
<link rel="stylesheet" href="{{asset "public/ghost.css" hasMinFile="true"}}" /> <link rel="stylesheet" href="{{asset "public/ghost.css" hasMinFile="true"}}" />
</head> </head>
@ -15,42 +18,34 @@
<div class="gh-viewport"> <div class="gh-viewport">
<main class="gh-main" role="main"> <main class="gh-main" role="main">
<div class="gh-flow"> <div class="gh-flow">
<header class="gh-flow-head gh-flow-head-unsubscribe">
<nav class="gh-flow-nav">
<a href="{{@site.url}}" class="gh-flow-back-plain">
<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
<svg width="17px" height="27px" viewBox="0 0 17 27" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"
stroke-linecap="round" stroke-linejoin="round">
<g id="Stroke-42" transform="translate(2.000000, 2.000000)" stroke-width="3"
stroke="#7d878a">
<polyline points="13.5401 0.4256 0.3971 11.9256 13.5401 23.4256"></polyline>
</g>
</g>
</svg>
Back to {{@site.title}}
</a>
</nav>
</header>
<div class="gh-flow-content-wrap"> <div class="gh-flow-content-wrap">
<section class="gh-flow-content gh-flow-content-unsubscribe"> {{#if @site.icon}}
<img class="site-icon" src="{{img_url @site.icon absolute="true"}}" layout="fixed">
{{/if}}
<section class="gh-flow-content unsubscribe">
{{#if error}} {{#if error}}
<h1>Unsubscribe failed.</h1>
<p>{{error}}</p> <p>{{error}}</p>
{{else}} {{else if member}}
{{#if member}} <h1>Successfully unsubscribed.</h1>
<p> <p>
<span class="gh-flow-em">{{member.email}}</span> has been successfully unsubscribed from emails. <span class="gh-flow-em">{{member.email}}</span> will no longer receive this newsletter.
{{#match member.status "!=" "free"}} {{#match member.status "!=" "free"}}
<br> This will not cancel your paid subscription{{#if @site.title}} to {{@site.title}}{{/if}}.
Don't worry, this will not cancel your paid subscription to {{@site.title}}. {{/match}}
{{/match}} </p>
</p>
<p>Didn't mean to do this? Manage your account <a href="{{@site.url}}/#/portal/account">here</a>.</p>
{{/if}}
{{/if}} {{/if}}
</section> </section>
<div class="unsubscribe-footer">
{{#unless error}}
<p>Didn't mean to do this? Manage your account <a href="{{@site.url}}/#/portal/account">here</a>.</p>
{{/unless}}
{{#if @site.title}}
<a href="{{@site.url}}">{{@site.title}}</a>
{{else}}
<a href="{{@site.url}}">Visit site</a>
{{/if}}
</div>
</div> </div>
</div> </div>
</main> </main>

View File

@ -249,14 +249,14 @@ const retryFailedEmail = async (emailModel) => {
async function handleUnsubscribeRequest(req) { async function handleUnsubscribeRequest(req) {
if (!req.url) { if (!req.url) {
throw new errors.BadRequestError({ throw new errors.BadRequestError({
message: 'Unsubscribe failed! Could not find member' message: 'Email address not found.'
}); });
} }
const {query} = url.parse(req.url, true); const {query} = url.parse(req.url, true);
if (!query || !query.uuid) { if (!query || !query.uuid) {
throw new errors.BadRequestError({ throw new errors.BadRequestError({
message: (query.preview ? 'Unsubscribe preview' : 'Unsubscribe failed! Could not find member') message: (query.preview ? 'Unsubscribe preview' : 'Email address not found.')
}); });
} }
@ -266,7 +266,7 @@ async function handleUnsubscribeRequest(req) {
if (!member) { if (!member) {
throw new errors.BadRequestError({ throw new errors.BadRequestError({
message: 'Unsubscribe failed! Could not find member' message: 'Email address not found.'
}); });
} }
@ -276,7 +276,7 @@ async function handleUnsubscribeRequest(req) {
} catch (err) { } catch (err) {
throw new errors.InternalServerError({ throw new errors.InternalServerError({
err, err,
message: 'Failed to unsubscribe member' message: 'Failed to unsubscribe this email address'
}); });
} }
} }

View File

@ -44,7 +44,7 @@ body {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
max-width: 500px; max-width: 500px;
min-height: 500px; min-height: 360px;
margin: 0 0 4vmin; margin: 0 0 4vmin;
padding: 40px; padding: 40px;
text-align: center; text-align: center;
@ -63,7 +63,7 @@ h1 {
letter-spacing: -0.02em; letter-spacing: -0.02em;
} }
p { p {
margin: 0 0 40px; margin: 0;
opacity: 0.7; opacity: 0.7;
font-weight: 400; font-weight: 400;
} }