Skip to content

Commit

Permalink
Use anchor tags in email templates (#4690)
Browse files Browse the repository at this point in the history
* replace styled_link and unstyled_link components with plan anchor tag in email templates

* format

* change formatting for better whitespace

* use phx-no-format on bad anchor
  • Loading branch information
ruslandoga authored Oct 17, 2024
1 parent 7458d72 commit 7a91ff1
Show file tree
Hide file tree
Showing 26 changed files with 80 additions and 175 deletions.
33 changes: 11 additions & 22 deletions lib/plausible_web/templates/email/check_stats_email.html.heex
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
Plausible is tracking your website stats without compromising the user experience and the privacy of your visitors.
<br /><br /> Here's how to get even more out of your Plausible experience: <br /><br /> *
<.unstyled_link href="https://plausible.io/docs/custom-event-goals">
Set up custom events
</.unstyled_link>
and
<.unstyled_link href="https://plausible.io/docs/pageview-goals">pageview goals</.unstyled_link>
to count actions you want your visitors to take<br />
<a href="https://plausible.io/docs/custom-event-goals">Set up custom events</a> and
<a href="https://plausible.io/docs/pageview-goals">pageview goals</a> to count actions you want your visitors to take<br />
* Running an ecommerce? Assign monetary values to custom events to track
<.unstyled_link href="https://plausible.io/docs/ecommerce-revenue-tracking">
revenue attribution
</.unstyled_link>
<a href="https://plausible.io/docs/ecommerce-revenue-tracking">revenue attribution</a>
<br /> * Follow the journey from a landing page to conversion with
<.unstyled_link href="https://plausible.io/docs/funnel-analysis">funnel analysis</.unstyled_link>
<a href="https://plausible.io/docs/funnel-analysis">funnel analysis</a>
<br /> *
<.unstyled_link href="https://plausible.io/docs/manual-link-tagging">
<a href="https://plausible.io/docs/manual-link-tagging">
Tag your social media, email and paid links
</.unstyled_link>
to see which campaigns are responsible for most conversions<br /> *
<.unstyled_link href="https://plausible.io/docs/custom-props/introduction">
Send custom properties
</.unstyled_link>
to collect data that we don't track automatically<br /> * Explore our
<.unstyled_link href="https://plausible.io/docs/stats-api">stats API</.unstyled_link>
to retrieve your stats and our
<.unstyled_link href="https://plausible.io/docs/sites-api">sites API</.unstyled_link>
to create and manage sites programmatically<br />
</a> to see which campaigns are responsible for most conversions<br />
* <a href="https://plausible.io/docs/custom-props/introduction">Send custom properties</a>
to collect data that we don't track automatically <br /> * Explore our
<a href="https://plausible.io/docs/stats-api">stats API</a> to retrieve your stats and our
<a href="https://plausible.io/docs/sites-api">sites API</a> to create and manage sites programmatically<br />
<br /><br />
<.unstyled_link href={plausible_url()}>View your Plausible dashboard now</.unstyled_link>
<a href={plausible_url()}>View your Plausible dashboard now</a>
for the most valuable traffic insights at a glance. <br /><br />
Do reply back to this email if you have any questions or need some guidance.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
You've activated your free 30-day trial of Plausible, a simple and privacy-friendly website analytics tool.
<br /><br />
<.unstyled_link href={"#{plausible_url()}/sites/new"}>Click here</.unstyled_link>
<a href={"#{plausible_url()}/sites/new"}>Click here</a>
to add your website URL, your timezone and install our one-line JavaScript snippet to start collecting visitor statistics.
<br /><br /> Do reply back to this email if you have any questions or need some guidance.
2 changes: 1 addition & 1 deletion lib/plausible_web/templates/email/csv_import.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@site_import.start_date
) %> to <%= date_format(@site_import.end_date) %>
<br /><br />
<.unstyled_link href={@link}>Click here</.unstyled_link>
<a href={@link}>Click here</a>
to view your dashboard.
<% else %>
Unfortunately, your CSV import for <%= @site_import.site.domain %> did not complete successfully. Sorry about that!
Expand Down
13 changes: 3 additions & 10 deletions lib/plausible_web/templates/email/dashboard_locked.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,12 @@ During the last billing cycle (<%= PlausibleWeb.TextHelpers.format_date_range(
) %>), your account recorded <%= PlausibleWeb.AuthView.delimit_integer(@usage.last_cycle.total) %> billable pageviews. In the billing cycle before that (<%= PlausibleWeb.TextHelpers.format_date_range(
@usage.penultimate_cycle.date_range
) %>), the usage was <%= PlausibleWeb.AuthView.delimit_integer(@usage.penultimate_cycle.total) %> billable pageviews. Note that billable pageviews include both standard pageviews and custom events. In your
<.unstyled_link href={
PlausibleWeb.Router.Helpers.settings_url(PlausibleWeb.Endpoint, :subscription)
}>
account settings
</.unstyled_link>, you'll find an overview of your usage and limits. <br /><br />
<a href={PlausibleWeb.Router.Helpers.settings_url(PlausibleWeb.Endpoint, :subscription)}>account settings</a>, you'll find an overview of your usage and limits.
<br /><br />
<%= if @suggested_plan == :enterprise do %>
Your usage exceeds our standard plans, so please reply back to this email for a tailored quote.
<% else %>
<.unstyled_link href={
PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)
}>
Click here to upgrade your subscription
</.unstyled_link>. We recommend you upgrade to the <%= @suggested_plan.volume %>/mo plan. The new charge will be prorated to reflect the amount you have already paid and the time until your current subscription is supposed to expire.
<a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)}>Click here to upgrade your subscription</a>. We recommend you upgrade to the <%= @suggested_plan.volume %>/mo plan. The new charge will be prorated to reflect the amount you have already paid and the time until your current subscription is supposed to expire.
<% end %>
<br /><br />
Do you have questions or need help with anything? Just reply to this email. We're here to help!
Expand Down
8 changes: 3 additions & 5 deletions lib/plausible_web/templates/email/drop_notification.html.heex
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
We've recorded <%= @current_visitors %> visitors on
<.unstyled_link href={"https://" <> @site.domain}><%= @site.domain %></.unstyled_link>
in the last 12 hours.
<a href={"https://" <> @site.domain}><%= @site.domain %></a> in the last 12 hours.
<%= if @dashboard_link do %>
<br /><br /> View dashboard:
<.unstyled_link href={@dashboard_link}><%= @dashboard_link %></.unstyled_link>
<br /><br /> View dashboard: <a href={@dashboard_link}><%= @dashboard_link %></a>
<br /><br /> Something looks off? Please
<.unstyled_link href={@installation_link}>review your installation</.unstyled_link>
<a href={@installation_link}>review your installation</a>
to verify that Plausible has been integrated correctly.
<% end %>
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<%= @invitation.inviter.email %> has invited you to the <%= @invitation.site.domain %> site on <%= Plausible.product_name() %>.
<.unstyled_link href={Routes.site_url(PlausibleWeb.Endpoint, :index)}>Click here</.unstyled_link>
to view and respond to the invitation. The invitation
<a href={Routes.site_url(PlausibleWeb.Endpoint, :index)}>Click here</a> to view and respond to the invitation. The invitation
will expire 48 hours after this email is sent.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@site_import.start_date
) %> to <%= date_format(@site_import.end_date) %>
<br /><br />
<.styled_link href={@link}>Click here</.styled_link>
<a href={@link}>Click here</a>
to view your dashboard.
<% else %>
Unfortunately, your Google Analytics import for <%= @site_import.site.domain %> did not complete successfully. Sorry about that!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
<%= @invitation.email %> has accepted your invitation to <%= @invitation.site.domain %>.
<.unstyled_link href={
Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)
}>
Click here
</.unstyled_link>
to view site settings.
<a href={Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)}>Click here</a> to view site settings.
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
<%= @invitation.email %> has rejected your invitation to <%= @invitation.site.domain %>.
<.unstyled_link href={
Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)
}>
Click here
</.unstyled_link>
to view site settings.
<a href={Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)}>Click here</a> to view site settings.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<%= @invitation.inviter.email %> has invited you to join the <%= @invitation.site.domain %> site on <%= Plausible.product_name() %>.
<.unstyled_link href={
<a href={
Routes.auth_url(
PlausibleWeb.Endpoint,
:register_from_invitation_form,
@invitation.invitation_id
)
}>
Click here
</.unstyled_link>
to create your account. The link is valid for 48 hours after this email is sent. <br /><br />
}>Click here</a> to create your account. The link is valid for 48 hours after this email is sent.
<br /><br />
Plausible is a lightweight and open-source website analytics tool. We hope you like our simple and ethical approach to tracking website visitors.
11 changes: 3 additions & 8 deletions lib/plausible_web/templates/email/over_limit.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ During the last billing cycle (<%= PlausibleWeb.TextHelpers.format_date_range(
) %>), your account recorded <%= PlausibleWeb.AuthView.delimit_integer(@usage.last_cycle.total) %> billable pageviews. In the billing cycle before that (<%= PlausibleWeb.TextHelpers.format_date_range(
@usage.penultimate_cycle.date_range
) %>), your account used <%= PlausibleWeb.AuthView.delimit_integer(@usage.penultimate_cycle.total) %> billable pageviews. Note that billable pageviews include both standard pageviews and custom events. In your
<.unstyled_link href={plausible_url() <> PlausibleWeb.Router.Helpers.settings_path(PlausibleWeb.Endpoint, :subscription)}>
account settings
</.unstyled_link>, you'll find an overview of your usage and limits. <br /><br />
<a href={plausible_url() <> PlausibleWeb.Router.Helpers.settings_path(PlausibleWeb.Endpoint, :subscription)}>account settings</a>, you'll find an overview of your usage and limits.
<br /><br />
<%= if @suggested_plan == :enterprise do %>
Your usage exceeds our standard plans, so please reply back to this email for a tailored quote.
<% else %>
<.unstyled_link href={
PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)
}>
Click here to upgrade your subscription
</.unstyled_link>. We recommend you upgrade to the <%= @suggested_plan.volume %>/mo plan. The new charge will be prorated to reflect the amount you have already paid and the time until your current subscription is supposed to expire.
<a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)}>Click here to upgrade your subscription</a>. We recommend you upgrade to the <%= @suggested_plan.volume %>/mo plan. The new charge will be prorated to reflect the amount you have already paid and the time until your current subscription is supposed to expire.
<% end %>
<br /><br />
Do you have questions or need help with anything? Just reply to this email. We're here to help!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
<%= @invitation.email %> has accepted the ownership transfer of <%= @invitation.site.domain %>. They will be responsible for billing of it going
forward and your role has been changed to <b>admin</b>.
<.unstyled_link href={
Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)
}>
Click here
</.unstyled_link>
to view site settings.
<a href={Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)}>Click here</a> to view site settings.
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
<%= @invitation.email %> has rejected the ownership transfer of <%= @invitation.site.domain %>.
<.unstyled_link href={
Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)
}>
Click here
</.unstyled_link>
to view site settings.
<a href={Routes.site_url(PlausibleWeb.Endpoint, :settings_general, @invitation.site.domain)}>Click here</a> to view site settings.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<%= @invitation.inviter.email %> has requested to transfer the ownership of <%= @invitation.site.domain %> site on <%= Plausible.product_name() %> to you.
<%= if @new_owner_account do %>
<.unstyled_link href={Routes.site_url(PlausibleWeb.Endpoint, :index)}>
Click here
</.unstyled_link>
<a href={Routes.site_url(PlausibleWeb.Endpoint, :index)}>Click here</a>
to view and respond to the invitation.
<% else %>
<.unstyled_link href={
Routes.auth_url(PlausibleWeb.Endpoint, :register_form, invitation: @invitation.invitation_id)
}>
Click here
</.unstyled_link>
to create your account. <br /><br />
<a
phx-no-format
href={
Routes.auth_url(PlausibleWeb.Endpoint, :register_form,
invitation: @invitation.invitation_id
)
}
>Click here</a> to create your account. <br /><br />
Plausible is a lightweight and open-source website analytics tool. We hope you like our simple and ethical approach to tracking website visitors.
<% end %>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
An administrator of <%= @membership.site.domain %> has removed you as a member. You won't be able to see the stats anymore.
<br /><br />
<.unstyled_link href={Routes.site_url(PlausibleWeb.Endpoint, :index)}>Click here</.unstyled_link>
<a href={Routes.site_url(PlausibleWeb.Endpoint, :index)}>Click here</a>
to view your sites.
18 changes: 5 additions & 13 deletions lib/plausible_web/templates/email/site_setup_help_email.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,10 @@
<br /><br />
<% end %>
To finish your setup for <%= @site.domain %>, review
<.unstyled_link href={"#{plausible_url()}/#{URI.encode_www_form(@site.domain)}/installation"}>
your installation
</.unstyled_link>
and start collecting visitor statistics. <br /><br />
<a href={"#{plausible_url()}/#{URI.encode_www_form(@site.domain)}/installation"}>your installation</a> and start collecting visitor statistics.
<br /><br />
This Plausible script is 45 times smaller than Google Analytics script so you’ll have a fast loading site while getting all the important traffic insights on one single page.
<br /><br /> On WordPress? We have a
<.unstyled_link href="https://plausible.io/wordpress-analytics-plugin">
WordPress plugin
</.unstyled_link>
that makes the process simpler. We also have
<.unstyled_link href="https://plausible.io/docs/integration-guides">
integration guides
</.unstyled_link>
for different site builders to help you start counting stats in no time. <br /><br />
Do reply back to this email if you have any questions or need some guidance.
<a href="https://plausible.io/wordpress-analytics-plugin">WordPress plugin</a> that makes the process simpler. We also have
<a href="https://plausible.io/docs/integration-guides">integration guides</a> for different site builders to help you start counting stats in no time.
<br /><br /> Do reply back to this email if you have any questions or need some guidance.
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
Congrats! We've recorded the first visitor on
<.unstyled_link href={"https://#{@site.domain}"}><%= @site.domain %></.unstyled_link>. Your traffic is now being counted without compromising the user experience and privacy of your visitors.
<br /><br /> Do check out your
<.unstyled_link href={"#{plausible_url()}/#{URI.encode_www_form(@site.domain)}"}>
easy to use, fast-loading and privacy-friendly dashboard
</.unstyled_link>. <br /><br /> Something looks off? Take a look at our
<.unstyled_link href="https://plausible.io/docs/troubleshoot-integration">
installation troubleshooting guide
</.unstyled_link>. <br /><br />
<a href={"https://#{@site.domain}"}><%= @site.domain %></a>. Your traffic is now being counted without compromising the user experience and privacy of your visitors.
<br /><br />
Do check out your <a href={"#{plausible_url()}/#{URI.encode_www_form(@site.domain)}"}>easy to use, fast-loading and privacy-friendly dashboard</a>.
<br /><br />
Something looks off? Take a look at our <a href="https://plausible.io/docs/troubleshoot-integration">installation troubleshooting guide</a>.
<br /><br />
<%= if not Plausible.ce?() and Plausible.Users.on_trial?(@user) do %>
You're on a 30-day free trial with no obligations so do take your time to explore Plausible. Here's how to get
<.unstyled_link href="https://plausible.io/docs/your-plausible-experience">
the most out of your Plausible experience
</.unstyled_link>. <br /><br />
You're on a 30-day free trial with no obligations so do take your time to explore Plausible.
Here's how to get <a href="https://plausible.io/docs/your-plausible-experience">the most out of your Plausible experience</a>.
<br /><br />
<% end %>
PS: You can import your historical Google Analytics stats into your Plausible dashboard.
<.unstyled_link href="https://plausible.io/docs/google-analytics-import">
Learn how our GA importer works
</.unstyled_link>. <br /><br />
<a href="https://plausible.io/docs/google-analytics-import">Learn how our GA importer works</a>.
<br /><br />
<%= unless Plausible.ce?() do %>
Do reply back to this email if you have any questions. We're here to help.
<% end %>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
There are currently <%= @current_visitors %> visitors on
<.unstyled_link href={"https://" <> @site.domain}><%= @site.domain %></.unstyled_link>.
<a href={"https://" <> @site.domain}><%= @site.domain %></a>.
<%= if Enum.count(@sources) > 0 do %>
<br />
<br /> The top sources for current visitors:<br />
Expand All @@ -9,7 +9,6 @@ There are currently <%= @current_visitors %> visitors on
<% end %>

<%= if @link do %>
<br /><br /> View dashboard:
<.unstyled_link href={@link}><%= @link %></.unstyled_link>
<br /><br /> View dashboard: <a href={@link}><%= @link %></a>
<% end %>
<br /><br /> Congrats on the spike in traffic!
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@ Time flies! Your 30-day free trial of Plausible will end next week. <br /><br />
Over the last three weeks, We hope you got to experience the potential benefits of having website stats in an easy to use dashboard while respecting the privacy of your visitors, not annoying them with the cookie and privacy notices and still having a fast loading site.
<br /><br />
In order to continue receiving valuable website traffic insights at a glance, you’ll need to
<.unstyled_link href={
PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)
}>
upgrade your account
</.unstyled_link>. <br /><br />
If you have any questions or feedback for us, feel free to reply to this email.
<a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)}>upgrade your account</a>.
<br /><br /> If you have any questions or feedback for us, feel free to reply to this email.
6 changes: 2 additions & 4 deletions lib/plausible_web/templates/email/trial_over_email.html.heex
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
Your free Plausible trial has now expired. Upgrade your account to continue receiving valuable website traffic insights at a glance while respecting the privacy of your visitors and still having a fast loading site.
<br /><br />

<.unstyled_link href={
PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)
}>
<a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)}>
Upgrade now
</.unstyled_link>
</a>
<br /><br />
We will keep recording stats for <%= @extra_offset %> days to give you time to upgrade.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ In the last month, your account has used <%= PlausibleWeb.AuthView.delimit_integ
This is more than our standard plans, so please reply back to this email to get a quote for your volume.
<% else %>
Based on that we recommend you select a <%= @suggested_plan.volume %>/mo plan. <br /><br />
<.unstyled_link href={
PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)
}>
<a href={PlausibleWeb.Router.Helpers.billing_url(PlausibleWeb.Endpoint, :choose_plan)}>
Upgrade now
</.unstyled_link>
</a>
<br /><br />
Have a question, feedback or need some guidance? Just reply to this email to get in touch!
<% end %>
Loading

0 comments on commit 7a91ff1

Please sign in to comment.