From d2fc89e7344a7e49ac67a5d0c38c1f2bd2d5b24f Mon Sep 17 00:00:00 2001 From: ruslandoga Date: Tue, 16 Apr 2024 16:10:59 +0800 Subject: [PATCH] use custom email template for csv imports (#4011) --- lib/plausible/imported/csv_importer.ex | 3 +-- .../templates/email/csv_import.html.heex | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 lib/plausible_web/templates/email/csv_import.html.heex diff --git a/lib/plausible/imported/csv_importer.ex b/lib/plausible/imported/csv_importer.ex index 4de8f7a4d..28d2ee517 100644 --- a/lib/plausible/imported/csv_importer.ex +++ b/lib/plausible/imported/csv_importer.ex @@ -12,9 +12,8 @@ defmodule Plausible.Imported.CSVImporter do @impl true def label(), do: "CSV" - # NOTE: change it once CSV import is implemented @impl true - def email_template(), do: "google_analytics_import.html" + def email_template(), do: "csv_import.html" @impl true def parse_args(%{"uploads" => uploads, "storage" => storage}) do diff --git a/lib/plausible_web/templates/email/csv_import.html.heex b/lib/plausible_web/templates/email/csv_import.html.heex new file mode 100644 index 000000000..b4ff1a4fc --- /dev/null +++ b/lib/plausible_web/templates/email/csv_import.html.heex @@ -0,0 +1,14 @@ +<%= if @success do %> + Your CSV import has completed successfully. The Plausible dashboard for <%= @site_import.site.domain %> now contains historical imported data from <%= date_format( + @site_import.start_date + ) %> to <%= date_format(@site_import.end_date) %> +

+ <%= link("Click here", to: @link) %> to view your dashboard. +<% else %> + Unfortunately, your CSV import for <%= @site_import.site.domain %> did not complete successfully. Sorry about that! +

Please try to do the import once again. + <%= if full_build?() do %> +

+ Please reply to this email to let us know if you're still experiencing issues with the import. + <% end %> +<% end %>