Skip to content

Commit

Permalink
fix: improved onboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Oct 18, 2023
1 parent ac05100 commit dd7ad7e
Show file tree
Hide file tree
Showing 35 changed files with 181 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .env.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ CHANGE_EMAIL_LIMIT_MS=30m
###########################
## global vanity domains ##
###########################
VANITY_DOMAINS=secret.fyi,hash.fyi,mailsire.com,hideaddress.net
VANITY_DOMAINS=mailsire.com,hideaddress.net,secret.fyi,hash.fyi

###################
## record prefix ##
Expand Down
11 changes: 11 additions & 0 deletions app/controllers/web/my-account/retrieve-domain-billing.js
Original file line number Diff line number Diff line change
Expand Up @@ -1751,6 +1751,17 @@ async function retrieveDomainBilling(ctx) {
redirectTo = ctx.state.l(`/denylist?q=${ctx.state.denylist}`);
}

// if the user doesn't have any domains yet then redirect them to create a new one
try {
const count = await Aliases.countDocuments({
domain: { $in: ctx.state.domains.map((d) => d._id) },
user: ctx.state.user._id
});
if (count === 0) redirectTo = ctx.state.l('/my-account/domains/new');
} catch (err) {
ctx.logger.fatal(err);
}

if (ctx.accepts('html')) ctx.redirect(redirectTo);
else ctx.body = { redirectTo };
} catch (err) {
Expand Down
5 changes: 4 additions & 1 deletion app/views/home.pug
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ block body
.row
.col-12.col-lg-6
h1.mb-3
= t("Free, private, and secure email for custom domains.")
if isBot(ctx.get("User-Agent"))
= t("Free, private, and secure email for custom domains.")
else
= t("Free, private, and secure email for everyone.")
p.d-none.d-md-block
!= t('For <span class="notranslate">%d</span> years and counting, we are the go-to email service for hundreds of thousands of creators, developers, and businesses.', dayjs().endOf("year").diff(dayjs("1/1/17", "M-D/YY"), "year"))
= " "
Expand Down
15 changes: 7 additions & 8 deletions app/views/my-account/domains/billing.pug
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,14 @@ block body
)
= t("Card, Wallet, or Bank")
= " "
a.btn.btn-link.text-themed.p-0.no-js(
href="#",
role="button",
data-toggle="tooltip",
data-placement="bottom",
aria-label=t("Payment Methods"),
title=t("We accept Visa, Mastercard, American Express, Discover, Diners Club, JCB, China UnionPay, Alipay, Apple Pay, Google Pay, Link, Bancontact, EPS, giropay, iDEAL, Przelewy24, Sofort, Affirm, Afterpay / Clearpay, Klarna, SEPA Direct Debit, Canadian pre-authorized debits, and ACH Direct Debit.")
button.confirm-prompt.btn.btn-link.text-themed.p-0.no-js(
type="button",
data-confirm-type="info",
data-confirm-show-cancel-button="false",
data-confirm-prompt-title=t("Payment Methods"),
data-confirm-prompt-html=t("We accept Visa, Mastercard, American Express, Discover, Diners Club, JCB, China UnionPay, Alipay, Apple Pay, Google Pay, Link, Bancontact, EPS, giropay, iDEAL, Przelewy24, Sofort, Affirm, Afterpay / Clearpay, Klarna, SEPA Direct Debit, Canadian pre-authorized debits, and ACH Direct Debit.")
)
i.fa.fa-question-circle
i.fa.fa-info-circle
.form-check.form-check-inline.mr-0.no-js
input#input-payment-method-paypal.form-check-input(
type="radio",
Expand Down
24 changes: 17 additions & 7 deletions app/views/my-account/domains/new.pug
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ block body
.row
.col
include ../../_breadcrumbs
.container.py-3
.container.pb-3.text-center
.row
.col-sm-12.col-md-12.col-lg-8.offset-lg-2
form.ajax-form(action=ctx.path, method="POST")
if isSANB(ctx.query.plan) && ['free','enhanced_protection','team'].includes(ctx.query.plan)
input(type="hidden", name="plan", value=ctx.query.plan)
.alert.alert-success.small
!= t('If you have a domain with <a href="https://www.namecheap.com/" class="alert-link notranslate" target="_blank" rel="noopener noreferrer">Namecheap</a>, <a href="https://developers.cloudflare.com/registrar/get-started/register-domain/" class="alert-link notranslate" target="_blank" rel="noopener noreferrer">Cloudflare</a>, <a href="https://www.godaddy.com/" class="alert-link notranslate" target="_blank" rel="noopener noreferrer">GoDaddy</a>, or another <a href="https://en.wikipedia.org/wiki/Domain_name_registrar" class="alert-link notranslate" target="_blank" rel="noopener noreferrer">registrar</a>, then enter it below:')
.form-group.floating-label
input#input-domain.form-control.form-control-lg(
required,
Expand All @@ -55,14 +57,22 @@ block body
)
label.form-check-label(for="input-is-global")= t("Global domain")
button.btn.btn-success.btn-block.btn-lg(type="submit")= t("Continue")
.alert.alert-warning.mt-3.text-center
ul.list-inline.mb-0
li.list-inline-item= t("Don't have a domain name?")
li.list-inline-item
a.alert-link(href=l("/domain-registration"))= t("Register a domain")
.hr-text.d-flex.text-secondary.align-items-center= t("or")
h3.mb-3= t("Use one of our domains:")
form(action=l('/my-account/domains/aliases/new'), method='GET')
.form-group.floating-label
select#input-group.form-control.input-lg(name="domain", required)
each vanityDomain, i in config.vanityDomains
span= i
strong= vanityDomain
option(value=vanityDomain, selected=i === 0)= vanityDomain
label(for="input-group")= t("Domain Name")
button.btn.btn-primary.btn-block.btn-lg(type="submit")= t("Continue")
.hr-text.d-flex.text-secondary.align-items-center= t("or")
a.btn.btn-dark.btn-lg(href=l("/domain-registration"))= t("Register a new domain name")
- const filteredDomains = domains.filter((domain) => !domain.is_global || domain.group === "admin");
if filteredDomains.length > 0
.row.text-center.my-5
.row.my-5
.col
a.btn.btn-outline-secondary(href=l("/my-account/domains"))
i.fa.fa-angle-double-left
Expand Down
2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const config = {
},

// vanity domains
vanityDomains: env.VANITY_DOMAINS.sort(),
vanityDomains: env.VANITY_DOMAINS,

// record prefix (matches SMTP)
recordPrefix: env.TXT_RECORD_PREFIX,
Expand Down
6 changes: 5 additions & 1 deletion locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -4951,5 +4951,9 @@
"Save your settings": "احفظ إعداداتك",
"You will not use our service to operate a service which allow third parties (other than your own employees and contractors) to access, use, or benefit from our service. If you need us to make an exception for you regarding this, then please contact us to discuss an enterprise agreement. See our": "لن تستخدم خدمتنا لتشغيل خدمة تسمح لأطراف ثالثة (بخلاف الموظفين والمقاولين لديك) بالوصول إلى خدمتنا أو استخدامها أو الاستفادة منها. إذا كنت تريد منا تقديم استثناء لك بخصوص هذا، فيرجى الاتصال بنا لمناقشة اتفاقية المؤسسة. انظر لدينا",
"for more information.": "للمزيد من المعلومات.",
"Maximum message size exceeded": "تم تجاوز الحد الأقصى لحجم الرسالة"
"Maximum message size exceeded": "تم تجاوز الحد الأقصى لحجم الرسالة",
"If you have a domain with <a href=\"https://www.namecheap.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Namecheap</a>, <a href=\"https://developers.cloudflare.com/registrar/get-started/register-domain/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Cloudflare</a>, <a href=\"https://www.godaddy.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">GoDaddy</a>, or another <a href=\"https://en.wikipedia.org/wiki/Domain_name_registrar\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">registrar</a>, then enter it below:": "إذا كان لديك نطاق به <a href=\"https://www.namecheap.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Namecheap</a> أو <a href=\"https://developers.cloudflare.com/registrar/get-started/register-domain/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Cloudflare</a> أو <a href=\"https://www.godaddy.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">GoDaddy</a> أو <a href=\"https://en.wikipedia.org/wiki/Domain_name_registrar\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">registrar</a> آخر، فأدخله أدناه:",
"Use one of our domains:": "استخدم أحد نطاقاتنا:",
"Register a new domain name": "قم بتسجيل اسم نطاق جديد",
"Free, private, and secure email for everyone.": "بريد إلكتروني مجاني وخاص وآمن للجميع."
}
6 changes: 5 additions & 1 deletion locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -4951,5 +4951,9 @@
"Save your settings": "Uložte nastavení",
"You will not use our service to operate a service which allow third parties (other than your own employees and contractors) to access, use, or benefit from our service. If you need us to make an exception for you regarding this, then please contact us to discuss an enterprise agreement. See our": "Nebudete používat naši službu k provozování služby, která třetím stranám (jiným než vašim vlastním zaměstnancům a dodavatelům) umožňuje přístup, používání nebo užitek z naší služby. Pokud potřebujete, abychom pro vás v této věci udělali výjimku, kontaktujte nás, abychom projednali podnikovou smlouvu. Podívejte se na naše",
"for more information.": "Pro více informací.",
"Maximum message size exceeded": "Překročena maximální velikost zprávy"
"Maximum message size exceeded": "Překročena maximální velikost zprávy",
"If you have a domain with <a href=\"https://www.namecheap.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Namecheap</a>, <a href=\"https://developers.cloudflare.com/registrar/get-started/register-domain/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Cloudflare</a>, <a href=\"https://www.godaddy.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">GoDaddy</a>, or another <a href=\"https://en.wikipedia.org/wiki/Domain_name_registrar\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">registrar</a>, then enter it below:": "Pokud máte doménu u <a href=\"https://www.namecheap.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Namecheap</a> , <a href=\"https://developers.cloudflare.com/registrar/get-started/register-domain/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Cloudflare</a> , <a href=\"https://www.godaddy.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">GoDaddy</a> nebo jiného <a href=\"https://en.wikipedia.org/wiki/Domain_name_registrar\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">registrar</a> , zadejte ji níže:",
"Use one of our domains:": "Využijte jednu z našich domén:",
"Register a new domain name": "Zaregistrujte si nový název domény",
"Free, private, and secure email for everyone.": "Bezplatný, soukromý a bezpečný e-mail pro každého."
}
6 changes: 5 additions & 1 deletion locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -4687,5 +4687,9 @@
"Save your settings": "Gem dine indstillinger",
"You will not use our service to operate a service which allow third parties (other than your own employees and contractors) to access, use, or benefit from our service. If you need us to make an exception for you regarding this, then please contact us to discuss an enterprise agreement. See our": "Du vil ikke bruge vores tjeneste til at drive en tjeneste, som tillader tredjeparter (bortset fra dine egne medarbejdere og kontrahenter) at få adgang til, bruge eller drage fordel af vores tjeneste. Hvis du har brug for, at vi gør en undtagelse for dig vedrørende dette, så kontakt os venligst for at drøfte en virksomhedsaftale. Se vores",
"for more information.": "for mere information.",
"Maximum message size exceeded": "Den maksimale meddelelsesstørrelse er overskredet"
"Maximum message size exceeded": "Den maksimale meddelelsesstørrelse er overskredet",
"If you have a domain with <a href=\"https://www.namecheap.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Namecheap</a>, <a href=\"https://developers.cloudflare.com/registrar/get-started/register-domain/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Cloudflare</a>, <a href=\"https://www.godaddy.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">GoDaddy</a>, or another <a href=\"https://en.wikipedia.org/wiki/Domain_name_registrar\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">registrar</a>, then enter it below:": "Hvis du har et domæne med <a href=\"https://www.namecheap.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Namecheap</a> , <a href=\"https://developers.cloudflare.com/registrar/get-started/register-domain/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Cloudflare</a> , <a href=\"https://www.godaddy.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">GoDaddy</a> eller en anden <a href=\"https://en.wikipedia.org/wiki/Domain_name_registrar\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">registrar</a> , så indtast det nedenfor:",
"Use one of our domains:": "Brug et af vores domæner:",
"Register a new domain name": "Registrer et nyt domænenavn",
"Free, private, and secure email for everyone.": "Gratis, privat og sikker e-mail til alle."
}
6 changes: 5 additions & 1 deletion locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -3979,5 +3979,9 @@
"Save your settings": "Speichern Sie Ihre Einstellungen",
"You will not use our service to operate a service which allow third parties (other than your own employees and contractors) to access, use, or benefit from our service. If you need us to make an exception for you regarding this, then please contact us to discuss an enterprise agreement. See our": "Sie werden unseren Dienst nicht dazu nutzen, einen Dienst zu betreiben, der es Dritten (außer Ihren eigenen Mitarbeitern und Auftragnehmern) ermöglicht, auf unseren Dienst zuzugreifen, ihn zu nutzen oder von ihm zu profitieren. Wenn wir diesbezüglich eine Ausnahme für Sie machen müssen, kontaktieren Sie uns bitte, um eine Unternehmensvereinbarung zu besprechen. Sehen Sie sich unsere an",
"for more information.": "für mehr Informationen.",
"Maximum message size exceeded": "Maximale Nachrichtengröße überschritten"
"Maximum message size exceeded": "Maximale Nachrichtengröße überschritten",
"If you have a domain with <a href=\"https://www.namecheap.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Namecheap</a>, <a href=\"https://developers.cloudflare.com/registrar/get-started/register-domain/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Cloudflare</a>, <a href=\"https://www.godaddy.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">GoDaddy</a>, or another <a href=\"https://en.wikipedia.org/wiki/Domain_name_registrar\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">registrar</a>, then enter it below:": "Wenn Sie eine Domain bei <a href=\"https://www.namecheap.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Namecheap</a> , <a href=\"https://developers.cloudflare.com/registrar/get-started/register-domain/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Cloudflare</a> , <a href=\"https://www.godaddy.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">GoDaddy</a> oder einem anderen <a href=\"https://en.wikipedia.org/wiki/Domain_name_registrar\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">registrar</a> haben, geben Sie diese unten ein:",
"Use one of our domains:": "Nutzen Sie eine unserer Domains:",
"Register a new domain name": "Registrieren Sie einen neuen Domainnamen",
"Free, private, and secure email for everyone.": "Kostenlose, private und sichere E-Mail für alle."
}
6 changes: 5 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4726,5 +4726,9 @@
"When prompted for IMAP server password, paste the password from": "When prompted for IMAP server password, paste the password from",
"Save your settings": "Save your settings",
"You will not use our service to operate a service which allow third parties (other than your own employees and contractors) to access, use, or benefit from our service. If you need us to make an exception for you regarding this, then please contact us to discuss an enterprise agreement. See our": "You will not use our service to operate a service which allow third parties (other than your own employees and contractors) to access, use, or benefit from our service. If you need us to make an exception for you regarding this, then please contact us to discuss an enterprise agreement. See our",
"for more information.": "for more information."
"for more information.": "for more information.",
"If you have a domain with <a href=\"https://www.namecheap.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Namecheap</a>, <a href=\"https://developers.cloudflare.com/registrar/get-started/register-domain/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Cloudflare</a>, <a href=\"https://www.godaddy.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">GoDaddy</a>, or another <a href=\"https://en.wikipedia.org/wiki/Domain_name_registrar\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">registrar</a>, then enter it below:": "If you have a domain with <a href=\"https://www.namecheap.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Namecheap</a>, <a href=\"https://developers.cloudflare.com/registrar/get-started/register-domain/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">Cloudflare</a>, <a href=\"https://www.godaddy.com/\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">GoDaddy</a>, or another <a href=\"https://en.wikipedia.org/wiki/Domain_name_registrar\" class=\"alert-link notranslate\" target=\"_blank\" rel=\"noopener noreferrer\">registrar</a>, then enter it below:",
"Use one of our domains:": "Use one of our domains:",
"Register a new domain name": "Register a new domain name",
"Free, private, and secure email for everyone.": "Free, private, and secure email for everyone."
}
Loading

0 comments on commit dd7ad7e

Please sign in to comment.