-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8b9505
commit 72291ca
Showing
42 changed files
with
302 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,31 +12,31 @@ defmodule PlausibleWeb.Email do | |
|> to(user) | ||
|> tag("activation-email") | ||
|> subject("#{code} is your Plausible email verification code") | ||
|> render("activation_email.html", user: user, code: code) | ||
|> render(:activation_email, user: user, code: code) | ||
end | ||
|
||
def welcome_email(user) do | ||
base_email() | ||
|> to(user) | ||
|> tag("welcome-email") | ||
|> subject("Welcome to Plausible") | ||
|> render("welcome_email.html", user: user) | ||
|> render(:welcome_email, user: user) | ||
end | ||
|
||
def create_site_email(user) do | ||
base_email() | ||
|> to(user) | ||
|> tag("create-site-email") | ||
|> subject("Your Plausible setup: Add your website details") | ||
|> render("create_site_email.html", user: user) | ||
|> render(:create_site_email, user: user) | ||
end | ||
|
||
def site_setup_help(user, site) do | ||
base_email() | ||
|> to(user) | ||
|> tag("help-email") | ||
|> subject("Your Plausible setup: Waiting for the first page views") | ||
|> render("site_setup_help_email.html", | ||
|> render(:site_setup_help_email, | ||
user: user, | ||
site: site | ||
) | ||
|
@@ -47,7 +47,7 @@ defmodule PlausibleWeb.Email do | |
|> to(user) | ||
|> tag("setup-success-email") | ||
|> subject("Plausible is now tracking your website stats") | ||
|> render("site_setup_success_email.html", | ||
|> render(:site_setup_success_email, | ||
user: user, | ||
site: site | ||
) | ||
|
@@ -58,39 +58,39 @@ defmodule PlausibleWeb.Email do | |
|> to(user) | ||
|> tag("check-stats-email") | ||
|> subject("Check your Plausible website stats") | ||
|> render("check_stats_email.html", user: user) | ||
|> render(:check_stats_email, user: user) | ||
end | ||
|
||
def password_reset_email(email, reset_link) do | ||
priority_email(%{layout: nil}) | ||
|> to(email) | ||
|> tag("password-reset-email") | ||
|> subject("Plausible password reset") | ||
|> render("password_reset_email.html", reset_link: reset_link) | ||
|> render(:password_reset_email, reset_link: reset_link) | ||
end | ||
|
||
def two_factor_enabled_email(user) do | ||
priority_email() | ||
|> to(user) | ||
|> tag("two-factor-enabled-email") | ||
|> subject("Plausible Two-Factor Authentication enabled") | ||
|> render("two_factor_enabled_email.html", user: user) | ||
|> render(:two_factor_enabled_email, user: user) | ||
end | ||
|
||
def two_factor_disabled_email(user) do | ||
priority_email() | ||
|> to(user) | ||
|> tag("two-factor-disabled-email") | ||
|> subject("Plausible Two-Factor Authentication disabled") | ||
|> render("two_factor_disabled_email.html", user: user) | ||
|> render(:two_factor_disabled_email, user: user) | ||
end | ||
|
||
def trial_one_week_reminder(user) do | ||
base_email() | ||
|> to(user) | ||
|> tag("trial-one-week-reminder") | ||
|> subject("Your Plausible trial expires next week") | ||
|> render("trial_one_week_reminder.html", user: user) | ||
|> render(:trial_one_week_reminder, user: user) | ||
end | ||
|
||
def trial_upgrade_email(user, day, usage) do | ||
|
@@ -100,7 +100,7 @@ defmodule PlausibleWeb.Email do | |
|> to(user) | ||
|> tag("trial-upgrade-email") | ||
|> subject("Your Plausible trial ends #{day}") | ||
|> render("trial_upgrade_email.html", | ||
|> render(:trial_upgrade_email, | ||
user: user, | ||
day: day, | ||
custom_events: usage.custom_events, | ||
|
@@ -114,7 +114,7 @@ defmodule PlausibleWeb.Email do | |
|> to(user) | ||
|> tag("trial-over-email") | ||
|> subject("Your Plausible trial has ended") | ||
|> render("trial_over_email.html", | ||
|> render(:trial_over_email, | ||
user: user, | ||
extra_offset: Plausible.Auth.User.trial_accept_traffic_until_offset_days() | ||
) | ||
|
@@ -133,7 +133,7 @@ defmodule PlausibleWeb.Email do | |
|> to(email) | ||
|> tag("spike-notification") | ||
|> subject("Traffic Spike on #{site.domain}") | ||
|> render("spike_notification.html", %{ | ||
|> render(:spike_notification, %{ | ||
site: site, | ||
current_visitors: current_visitors, | ||
sources: sources, | ||
|
@@ -146,7 +146,7 @@ defmodule PlausibleWeb.Email do | |
|> to(user) | ||
|> tag("over-limit") | ||
|> subject("[Action required] You have outgrown your Plausible subscription tier") | ||
|> render("over_limit.html", %{ | ||
|> render(:over_limit, %{ | ||
user: user, | ||
usage: usage, | ||
suggested_plan: suggested_plan | ||
|
@@ -158,7 +158,7 @@ defmodule PlausibleWeb.Email do | |
|> to("[email protected]") | ||
|> tag("enterprise-over-limit") | ||
|> subject("#{user.email} has outgrown their enterprise plan") | ||
|> render("enterprise_over_limit_internal.html", %{ | ||
|> render(:enterprise_over_limit_internal, %{ | ||
user: user, | ||
pageview_usage: pageview_usage, | ||
site_usage: site_usage, | ||
|
@@ -171,7 +171,7 @@ defmodule PlausibleWeb.Email do | |
|> to(user) | ||
|> tag("dashboard-locked") | ||
|> subject("[Action required] Your Plausible dashboard is now locked") | ||
|> render("dashboard_locked.html", %{ | ||
|> render(:dashboard_locked, %{ | ||
user: user, | ||
usage: usage, | ||
suggested_plan: suggested_plan | ||
|
@@ -185,7 +185,7 @@ defmodule PlausibleWeb.Email do | |
|> to(user) | ||
|> tag("yearly-renewal") | ||
|> subject("Your Plausible subscription is up for renewal") | ||
|> render("yearly_renewal_notification.html", %{ | ||
|> render(:yearly_renewal_notification, %{ | ||
user: user, | ||
date: date, | ||
next_bill_amount: user.subscription.next_bill_amount, | ||
|
@@ -205,7 +205,7 @@ defmodule PlausibleWeb.Email do | |
|> to(user) | ||
|> tag("yearly-expiration") | ||
|> subject("Your Plausible subscription is about to expire") | ||
|> render("yearly_expiration_notification.html", %{ | ||
|> render(:yearly_expiration_notification, %{ | ||
user: user, | ||
next_bill_date: next_bill_date, | ||
accept_traffic_until: accept_traffic_until | ||
|
@@ -217,15 +217,15 @@ defmodule PlausibleWeb.Email do | |
|> to(user.email) | ||
|> tag("cancelled-email") | ||
|> subject("Mind sharing your thoughts on Plausible?") | ||
|> render("cancellation_email.html", user: user) | ||
|> render(:cancellation_email, user: user) | ||
end | ||
|
||
def new_user_invitation(invitation) do | ||
priority_email() | ||
|> to(invitation.email) | ||
|> tag("new-user-invitation") | ||
|> subject("[#{Plausible.product_name()}] You've been invited to #{invitation.site.domain}") | ||
|> render("new_user_invitation.html", | ||
|> render(:new_user_invitation, | ||
invitation: invitation | ||
) | ||
end | ||
|
@@ -235,7 +235,7 @@ defmodule PlausibleWeb.Email do | |
|> to(invitation.email) | ||
|> tag("existing-user-invitation") | ||
|> subject("[#{Plausible.product_name()}] You've been invited to #{invitation.site.domain}") | ||
|> render("existing_user_invitation.html", | ||
|> render(:existing_user_invitation, | ||
invitation: invitation | ||
) | ||
end | ||
|
@@ -247,7 +247,7 @@ defmodule PlausibleWeb.Email do | |
|> subject( | ||
"[#{Plausible.product_name()}] Request to transfer ownership of #{invitation.site.domain}" | ||
) | ||
|> render("ownership_transfer_request.html", | ||
|> render(:ownership_transfer_request, | ||
invitation: invitation, | ||
new_owner_account: new_owner_account | ||
) | ||
|
@@ -260,7 +260,7 @@ defmodule PlausibleWeb.Email do | |
|> subject( | ||
"[#{Plausible.product_name()}] #{invitation.email} accepted your invitation to #{invitation.site.domain}" | ||
) | ||
|> render("invitation_accepted.html", | ||
|> render(:invitation_accepted, | ||
user: invitation.inviter, | ||
invitation: invitation | ||
) | ||
|
@@ -273,7 +273,7 @@ defmodule PlausibleWeb.Email do | |
|> subject( | ||
"[#{Plausible.product_name()}] #{invitation.email} rejected your invitation to #{invitation.site.domain}" | ||
) | ||
|> render("invitation_rejected.html", | ||
|> render(:invitation_rejected, | ||
user: invitation.inviter, | ||
invitation: invitation | ||
) | ||
|
@@ -286,7 +286,7 @@ defmodule PlausibleWeb.Email do | |
|> subject( | ||
"[#{Plausible.product_name()}] #{invitation.email} accepted the ownership transfer of #{invitation.site.domain}" | ||
) | ||
|> render("ownership_transfer_accepted.html", | ||
|> render(:ownership_transfer_accepted, | ||
user: invitation.inviter, | ||
invitation: invitation | ||
) | ||
|
@@ -299,7 +299,7 @@ defmodule PlausibleWeb.Email do | |
|> subject( | ||
"[#{Plausible.product_name()}] #{invitation.email} rejected the ownership transfer of #{invitation.site.domain}" | ||
) | ||
|> render("ownership_transfer_rejected.html", | ||
|> render(:ownership_transfer_rejected, | ||
user: invitation.inviter, | ||
invitation: invitation | ||
) | ||
|
@@ -312,7 +312,7 @@ defmodule PlausibleWeb.Email do | |
|> subject( | ||
"[#{Plausible.product_name()}] Your access to #{membership.site.domain} has been revoked" | ||
) | ||
|> render("site_member_removed.html", | ||
|> render(:site_member_removed, | ||
user: membership.user, | ||
membership: membership | ||
) | ||
|
@@ -371,7 +371,7 @@ defmodule PlausibleWeb.Email do | |
|> to(user) | ||
|> tag("export-success") | ||
|> subject("[#{Plausible.product_name()}] Your export is now ready for download") | ||
|> render("export_success.html", | ||
|> render(:export_success, | ||
user: user, | ||
site: site, | ||
download_url: download_url, | ||
|
@@ -383,7 +383,7 @@ defmodule PlausibleWeb.Email do | |
priority_email() | ||
|> to(user) | ||
|> subject("[#{Plausible.product_name()}] Your export has failed") | ||
|> render("export_failure.html", user: user, site: site) | ||
|> render(:export_failure, user: user, site: site) | ||
end | ||
|
||
def error_report(reported_by, trace_id, feedback) do | ||
|
@@ -394,7 +394,7 @@ defmodule PlausibleWeb.Email do | |
|> put_param("ReplyTo", reported_by) | ||
|> tag("sentry") | ||
|> subject("Feedback to Sentry Trace #{trace_id}") | ||
|> render("error_report_email.html", %{ | ||
|> render(:error_report_email, %{ | ||
reported_by: reported_by, | ||
feedback: feedback, | ||
trace_id: trace_id | ||
|
@@ -406,7 +406,7 @@ defmodule PlausibleWeb.Email do | |
|> to(notification.email) | ||
|> tag("drop-traffic-warning-first") | ||
|> subject("We'll stop counting your stats") | ||
|> render("approaching_accept_traffic_until.html", | ||
|> render(:approaching_accept_traffic_until, | ||
time: "next week", | ||
user: %{email: notification.email, name: notification.name} | ||
) | ||
|
@@ -417,7 +417,7 @@ defmodule PlausibleWeb.Email do | |
|> to(notification.email) | ||
|> tag("drop-traffic-warning-final") | ||
|> subject("A reminder that we'll stop counting your stats tomorrow") | ||
|> render("approaching_accept_traffic_until.html", | ||
|> render(:approaching_accept_traffic_until, | ||
time: "tomorrow", | ||
user: %{email: notification.email, name: notification.name} | ||
) | ||
|
@@ -427,14 +427,14 @@ defmodule PlausibleWeb.Email do | |
Unlike the default 'base' emails, priority emails cannot be unsubscribed from. This is achieved | ||
by sending them through a dedicated 'priority' message stream in Postmark. | ||
""" | ||
def priority_email(), do: priority_email(%{layout: "priority_email.html"}) | ||
def priority_email(), do: priority_email(%{layout: :priority_email}) | ||
|
||
def priority_email(%{layout: layout}) do | ||
base_email(%{layout: layout}) | ||
|> put_param("MessageStream", "priority") | ||
end | ||
|
||
def base_email(), do: base_email(%{layout: "base_email.html"}) | ||
def base_email(), do: base_email(%{layout: :base_email}) | ||
|
||
def base_email(%{layout: layout}) do | ||
mailer_from = Application.get_env(:plausible, :mailer_email) | ||
|
@@ -447,7 +447,7 @@ defmodule PlausibleWeb.Email do | |
|
||
defp maybe_put_layout(email, nil), do: email | ||
|
||
defp maybe_put_layout(email, layout) do | ||
put_html_layout(email, {PlausibleWeb.LayoutView, layout}) | ||
defp maybe_put_layout(email, layout) when is_atom(layout) do | ||
put_layout(email, {PlausibleWeb.LayoutView, layout}) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Enter <%= @code %> to verify your email address. This code will expire in 4 hours. |
7 changes: 7 additions & 0 deletions
7
lib/plausible_web/templates/email/approaching_accept_traffic_until.text.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
You used to have an active account with <%= Plausible.product_name() %>, a simple, lightweight, open source and privacy-first Google Analytics alternative. | ||
|
||
We've noticed that you're still sending us stats so we're writing to inform you that we'll stop accepting stats from your sites <%= @time %>. We're an independent, bootstrapped service and we don't sell your data, so this will reduce our server costs and help keep us sustainable. | ||
|
||
If you'd like to continue counting your site stats in a privacy-friendly way, please login to your Plausible account at <%= plausible_url() %> and start a subscription. | ||
|
||
Do you have any questions or need help with anything? Just reply to this email and we'll gladly help. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is Marko, one of the co-founders of Plausible. I'd love to understand the reasons behind your decision to cancel your subscription. We're solely funded by our subscribers so we genuinely value your feedback. Even a few words would be beneficial in helping us improve our product. Please respond to this email with any insights you can share. Thank you for your time! |
14 changes: 14 additions & 0 deletions
14
lib/plausible_web/templates/email/check_stats_email.text.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Plausible is tracking your website stats without compromising the user experience and the privacy of your visitors. | ||
|
||
Here's how to get even more out of your Plausible experience: | ||
|
||
* Set up custom events: https://plausible.io/docs/custom-event-goals and pageview goals: https://plausible.io/docs/pageview-goals to count actions you want your visitors to take | ||
* Running an ecommerce? Assign monetary values to custom events to track revenue attribution: https://plausible.io/docs/ecommerce-revenue-tracking | ||
* Follow the journey from a landing page to conversion with funnel analysis: https://plausible.io/docs/funnel-analysis | ||
* Tag your social media, email and paid links: https://plausible.io/docs/manual-link-tagging to see which campaigns are responsible for most conversions | ||
* Send custom properties: https://plausible.io/docs/custom-props/introduction to collect data that we don't track automatically | ||
* Explore our stats API: https://plausible.io/docs/stats-api to retrieve your stats and our sites API: https://plausible.io/docs/sites-api to create and manage sites programmatically | ||
|
||
View your Plausible dashboard now: <%= plausible_url() %> for the most valuable traffic insights at a glance. | ||
|
||
Do reply back to this email if you have any questions or need some guidance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
You've activated your free 30-day trial of Plausible, a simple and privacy-friendly website analytics tool. | ||
|
||
Click here: <%= "#{plausible_url()}/sites/new" %> to add your website URL, your timezone and install our one-line JavaScript snippet to start collecting visitor statistics. | ||
|
||
Do reply back to this email if you have any questions or need some guidance. |
Oops, something went wrong.