From 2c78f1ad39e43889628aa327a5eddd75ee92770c Mon Sep 17 00:00:00 2001
From: Aditya Bisht
Date: Sun, 4 Aug 2024 17:02:37 -0700
Subject: [PATCH 1/4] chore: add email alerts
---
packages/relayer/eml_templates/error.html | 3 +-
.../relayer/eml_templates/error_alert.html | 417 ++++++++++++++++++
packages/relayer/src/config.rs | 6 +
packages/relayer/src/lib.rs | 5 +
packages/relayer/src/modules/claimer.rs | 2 +-
packages/relayer/src/modules/mail.rs | 30 +-
.../src/modules/web_server/rest_api.rs | 1 +
packages/relayer/src/utils/strings.rs | 1 +
packages/relayer/src/utils/utils.rs | 2 +-
9 files changed, 460 insertions(+), 7 deletions(-)
create mode 100644 packages/relayer/eml_templates/error_alert.html
diff --git a/packages/relayer/eml_templates/error.html b/packages/relayer/eml_templates/error.html
index 07ce9ede..341724ff 100644
--- a/packages/relayer/eml_templates/error.html
+++ b/packages/relayer/eml_templates/error.html
@@ -166,8 +166,7 @@
margin-bottom: 15px;
"
>
- Your email transaction failed due to the following error:
- {{errorMsg}}
+ Your email transaction failed. Please try again later.
diff --git a/packages/relayer/eml_templates/error_alert.html b/packages/relayer/eml_templates/error_alert.html
new file mode 100644
index 00000000..88ec9b1d
--- /dev/null
+++ b/packages/relayer/eml_templates/error_alert.html
@@ -0,0 +1,417 @@
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Hi {{userEmailAddr}}!
+
+
+ The email transaction {{subject}} from {{emailAddr}} failed with the following error:
+ {{error}}
+
+ |
+
+
+
+ View Wallet on Explorer
+
+ |
+
+
+
+
+
+
+
+
+ |
+ |
+
+
+
+
diff --git a/packages/relayer/src/config.rs b/packages/relayer/src/config.rs
index a69938e9..61daf6ca 100644
--- a/packages/relayer/src/config.rs
+++ b/packages/relayer/src/config.rs
@@ -7,6 +7,7 @@ use dotenv::dotenv;
#[derive(Clone)]
pub struct RelayerConfig {
pub smtp_server: String,
+ pub error_email_addresses: Vec