Skip to content

Commit

Permalink
fix: updated welcome email and upgrade verbiage in emails
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Oct 1, 2023
1 parent ab8ecde commit 3940358
Show file tree
Hide file tree
Showing 36 changed files with 1,171 additions and 72 deletions.
3 changes: 2 additions & 1 deletion assets/css/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $fontAwesomeFree: 'Font Awesome 5 Free';
font-weight: 900;
}

$font-family-sans-serif: 'Nunito Sans', '-apple-system', BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
$font-family-sans-serif: 'Nunito Sans', 'Helvetica Neue', Arial, sans-serif;

$font-family-monospace: Inconsolata-dz, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

Expand All @@ -23,6 +23,7 @@ $font-family-base: $font-family-sans-serif;
$headings-font-family: $font-family-sans-serif;
$headings-font-weight: 700;
$lead-font-weight: 400;
//$badge-font-weight: 400;

// For lighthouse to pass Accessibility audit we darken this for bots
// stylelint-disable-next-line scss/no-global-function-names
Expand Down
42 changes: 42 additions & 0 deletions emails/_upgrade.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.p-3.text-center
h2.h2= t("Need Enhanced Protection?")
h3.h5.text-danger.text-decoration-underline= t("Your email is publicly searchable!")
span.badge.badge-dark!= ("Anyone can run this command:")
.d-block.mb-1
pre.d-inline-block.mx-auto.bg-dark.p-3.rounded.text-white.mb-0
code.d-block
= "dig"
= " "
= domain && domain.name ? domain.name : "yourdomain.com"
= " "
= "txt"
span.badge.badge-danger!= ("It exposes your email:")
.d-block.mb-1
pre.d-inline-block.mx-auto.bg-dark.p-3.rounded.text-white.mb-0
code.d-block
= "forward-email="
span.font-weight-bold(style="color: red")= to ? to : user && user.email ? user.email : "[email protected]"
a.btn.btn-lg.btn-danger.mb-3(
href=domain && domain.name ? `${config.urls.web}/${locale}/my-account/domains/${domain.name}/billing?plan=enhanced_protection` : `${config.urls.web}/my-account/billing/upgrade?plan=enhanced_protection`,
role="button"
)
= emoji("point_right")
= " "
= t("Hide your email")
= " "
= emoji("point_left")
p.card-text.small
= t("If you upgrade to the Enhanced Protection plan, then your forwarding addresses will be kept private and encrypted.")
= " "
!= t('<strong>Upgrading will also unlock access to <a href="%s" target="_blank">real-time error log alerts</a> and <a href="%s" target="_blank">outbound SMTP</a></strong>.', `${config.urls.web}/faq#do-you-store-error-logs`, `${config.urls.web}/guides/send-email-with-custom-domain-smtp`)
= " "
= t("These features will help you to ensure high deliverability and prevent email spoofing attacks.")
= " "
= t("The cost is only $3 per month and gives you unlimited domains, aliases, and more.")
= " "
= t("We also offer a 30-day automatic refund guarantee.")
a.btn.btn-lg.btn-success(
href=domain && domain.name ? `${config.urls.web}/${locale}/my-account/domains/${domain.name}/billing?plan=enhanced_protection` : `${config.urls.web}/my-account/billing/upgrade?plan=enhanced_protection`,
role="button"
)
= t("Upgrade for $3")
13 changes: 1 addition & 12 deletions emails/domain-configuration-issue/html.pug
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,7 @@ block content
if errorMessage
!= prefixHTMLPathBasedAnchors(errorMessage, config.urls.web)
if domain.plan === 'free'
.p-3.text-center
h2.h5= t("Did you want enhanced privacy and error logs?")
p.card-text
!= t('Currently <strong>you are on the free plan</strong>, which means <strong class="text-danger">your forwarding addresses are publicly searchable</strong> over DNS lookups.')
= " "
= t("If you upgrade to the Enhanced Protection plan, then your forwarding addresses will be kept private and encrypted.")
= " "
!= t('<strong>Upgrading will also unlock your access to <a href="%s" target="_blank">error logs</a></strong>, which helps you to ensure high deliverability and prevent spam false positives.', `${config.urls.web}/faq#do-you-store-error-logs`)
a.btn.btn-lg.btn-danger(
href=`${config.urls.web}/${locale}/my-account/domains/${domain.name}/billing?plan=enhanced_protection`,
role="button"
)= t("Upgrade for $3")
include ../_upgrade
.px-3.py-3.py-md-4.py-lg-5.bg-dark.mt-3.text-center
h2.display-6.mb-3.text-uppercase.text-white= t("Verification Status")
ul.list-inline.mb-3
Expand Down
13 changes: 1 addition & 12 deletions emails/domain-onboard/html.pug
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,7 @@ block content
h2.h5= t("Issues Detected")
p.card-text!= prefixHTMLPathBasedAnchors(errorMessage, config.urls.web)
if domain.plan === 'free'
.p-3.text-center
h2.h5= t("Did you want enhanced privacy and error logs?")
p.card-text
!= t('Currently <strong>you are on the free plan</strong>, which means <strong class="text-danger">your forwarding addresses are publicly searchable</strong> over DNS lookups.')
= " "
= t("If you upgrade to the Enhanced Protection plan, then your forwarding addresses will be kept private and encrypted.")
= " "
!= t('<strong>Upgrading will also unlock your access to <a href="%s" target="_blank">error logs</a></strong>, which helps you to ensure high deliverability and prevent spam false positives.', `${config.urls.web}/faq#do-you-store-error-logs`)
a.btn.btn-lg.btn-danger(
href=`${config.urls.web}/${locale}/my-account/domains/${domain.name}/billing?plan=enhanced_protection`,
role="button"
)= t("Upgrade for $3")
include ../_upgrade
//- TODO: render this email differently
if !domain.has_mx_record || !domain.has_txt_record
.p-3
Expand Down
13 changes: 1 addition & 12 deletions emails/domain-verified/html.pug
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,7 @@ block content
h2.h5= t("Issues Detected")
p.card-text!= prefixHTMLPathBasedAnchors(errorMessage, config.urls.web)
if domain.plan === 'free'
.p-3.text-center
h2.h5= t("Did you want enhanced privacy and error logs?")
p.card-text
!= t('Currently <strong>you are on the free plan</strong>, which means <strong class="text-danger">your forwarding addresses are publicly searchable</strong> over DNS lookups.')
= " "
= t("If you upgrade to the Enhanced Protection plan, then your forwarding addresses will be kept private and encrypted.")
= " "
!= t('<strong>Upgrading will also unlock your access to <a href="%s" target="_blank">error logs</a></strong>, which helps you to ensure high deliverability and prevent spam false positives.', `${config.urls.web}/faq#do-you-store-error-logs`)
a.btn.btn-lg.btn-danger(
href=`${config.urls.web}/${locale}/my-account/domains/${domain.name}/billing?plan=enhanced_protection`,
role="button"
)= t("Upgrade for $3")
include ../_upgrade
.px-3.py-3.py-md-4.py-lg-5.bg-dark.mt-3
h2.display-6.mb-3.text-uppercase.text-white= t("Verification Status")
ul.list-inline
Expand Down
103 changes: 98 additions & 5 deletions emails/welcome/html.pug
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,111 @@ block content
.row
.col-12
.card.border-dark.d-block.text-center
h1.h5.card-header= t("You're ready to go!")
h1.h5.card-header= t("Thank you for joining us")
.card-body.text-center.p-0
a(href=`${config.urls.web}/${locale}/my-account`)
img.img-fluid.d-block.align-top(
src=manifest("img/emails/welcome.gif"),
alt=""
)
.p-3
h1.h3!= t("Woo-hoo!")
p.card-text= t("Now you can add your domains and set up free email forwarding!")
a.btn.btn-lg.btn-block.btn-primary(
h1.h3= t("Features")
ul.list-unstyled.text-left.mb-0.text-monospace.d-inline-block.mx-auto
li
= emoji("white_check_mark")
= " "
= t("Unlimited domains and aliases")
= " "
span.badge.text-uppercase.font-weight-normal.badge-success
= t("100% Free")
li
= emoji("white_check_mark")
= " "
= t("Privacy-focused email")
= " "
a.badge.text-uppercase.font-weight-normal.badge-primary.align-middle(href=`${config.urls.web}/${locale}/privacy`)
= t("Privacy Policy")
= " "
!= "&rarr;"
li
= emoji("white_check_mark")
= " "
= t("Send outbound SMTP email")
= " "
a.badge.text-uppercase.font-weight-normal.badge-primary(
href=`${config.urls.web}/${locale}/guides/send-email-with-custom-domain-smtp`
)
= t("SMTP Guide")
= " "
!= "&rarr;"
li
= emoji("white_check_mark")
= " "
= t("Error logs and real-time alerts")
= " "
a.badge.text-uppercase.font-weight-normal.badge-primary(
href=`${config.urls.web}/${locale}/faq#do-you-store-error-logs`
)
= t("View FAQ")
= " "
!= "&rarr;"
li
= emoji("white_check_mark")
= " "
= t("Powered by bare metal servers")
= " "
a.badge.text-uppercase.font-weight-normal.badge-primary(
href="https://status.forwardemail.net",
target="_blank",
rel="noopener noreferrer"
)
= t("Status Page")
= " "
!= "&rarr;"
li
= emoji("white_check_mark")
= " "
= t("100% open-source software")
= " "
a.badge.text-uppercase.font-weight-normal.badge-primary(
href="https://github.com/forwardemail",
target="_blank",
rel="noopener noreferrer"
)
= t("View")
= " "
= t("GitHub")
= " "
!= "&rarr;"
li
= emoji("white_check_mark")
= " "
= t("Email API designed for developers")
= " "
a.badge.text-uppercase.font-weight-normal.badge-primary(href=`${config.urls.web}/${locale}/email-api`)
= t("Email API")
= " "
!= "&rarr;"
if user.plan === 'free'
include ../_upgrade
.p-3
h1.h3!= t("Did you need help?")
p.card-text!= t("Feel free to reply, contact support, or read our FAQ.")
ul.list-inline.mb-0
li.list-inline-item
a.btn.btn-lg.btn-warning(
href=`${config.urls.web}/${locale}/help`
)
= t("Contact Support")
li.list-inline-item
a.btn.btn-lg.btn-primary(
href=`${config.urls.web}/${locale}/faq`
)
= t("FAQ")
.p-3
h1.h3!= t("Need to manage your domains?")
a.btn.btn-lg.btn-dark(
href=`${config.urls.web}/${locale}/my-account`
)
= t("Get started now")
= t("Go to My Account")
.card-footer.small.text-muted= t("If you have any questions or comments, then please let us know")
4 changes: 4 additions & 0 deletions jobs/check-bad-domains.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ async function mapper(id) {
template: 'domain-configuration-issue',
message: { to },
locals: {
to,
locale,
domain,
errorMessage
Expand All @@ -201,6 +202,7 @@ async function mapper(id) {
template: 'domain-configuration-issue',
message: { to },
locals: {
to,
locale,
domain,
errorMessage
Expand Down Expand Up @@ -228,6 +230,7 @@ async function mapper(id) {
template: 'domain-verified',
message: { to },
locals: {
to,
locale,
domain,
errorMessage
Expand Down Expand Up @@ -255,6 +258,7 @@ async function mapper(id) {
template: 'domain-onboard',
message: { to },
locals: {
to,
locale,
domain,
errorMessage
Expand Down
4 changes: 4 additions & 0 deletions jobs/check-domains.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ async function mapper(id) {
template: 'domain-configuration-issue',
message: { to },
locals: {
to,
locale,
domain,
errorMessage
Expand All @@ -201,6 +202,7 @@ async function mapper(id) {
template: 'domain-configuration-issue',
message: { to },
locals: {
to,
locale,
domain,
errorMessage
Expand Down Expand Up @@ -228,6 +230,7 @@ async function mapper(id) {
template: 'domain-verified',
message: { to },
locals: {
to,
locale,
domain,
errorMessage
Expand Down Expand Up @@ -255,6 +258,7 @@ async function mapper(id) {
template: 'domain-onboard',
message: { to },
locals: {
to,
locale,
domain,
errorMessage
Expand Down
15 changes: 14 additions & 1 deletion jobs/welcome-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const email = require('#helpers/email');
const logger = require('#helpers/logger');
const setupMongoose = require('#helpers/setup-mongoose');
const Users = require('#models/users');
const Domains = require('#models/domains');

const graceful = new Graceful({
mongooses: [mongoose],
Expand Down Expand Up @@ -48,13 +49,25 @@ graceful.listen();
// in case email was sent for whatever reason
if (user[config.userFields.welcomeEmailSentAt]) return;

// find a domain that the user created
const domain = await Domains.findOne({
members: {
$elemMatch: {
user: user._id,
group: 'admin'
}
}
})
.lean()
.exec();

// send email
await email({
template: 'welcome',
message: {
to: user[config.userFields.fullEmail]
},
locals: { user }
locals: { user, domain }
});

// store that we sent this email
Expand Down
Loading

0 comments on commit 3940358

Please sign in to comment.