Skip to content

Commit

Permalink
chore: Add Email Alerts (#97)
Browse files Browse the repository at this point in the history
* chore: add email alerts

* chore: update .env.example

* chore: update k8s manifest
  • Loading branch information
Bisht13 authored Aug 6, 2024
1 parent 9eba855 commit bd9552e
Show file tree
Hide file tree
Showing 11 changed files with 493 additions and 8 deletions.
33 changes: 32 additions & 1 deletion kubernetes/cronjob.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,45 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: cronjob-service-account
namespace: email-wallet
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: email-wallet
name: deployment-restart-role
rules:
- apiGroups: ["apps", "extensions"]
resources: ["deployments"]
verbs: ["get", "list", "watch", "update", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: deployment-restart-rolebinding
namespace: email-wallet
subjects:
- kind: ServiceAccount
name: cronjob-service-account
namespace: email-wallet
roleRef:
kind: Role
name: deployment-restart-role
apiGroup: rbac.authorization.k8s.io
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: restart-deployment
namespace: email-wallet
spec:
schedule: "0 0 * * 0" # Runs every Sunday at midnight
schedule: "0 * * * *"
jobTemplate:
spec:
template:
spec:
serviceAccountName: cronjob-service-account
containers:
- name: kubectl
image: bitnami/kubectl:latest
Expand Down
1 change: 1 addition & 0 deletions packages/relayer/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CHAIN_RPC_EXPLORER=
CHAIN_ID=11155111 # Chain ID of the testnet.

SMTP_SERVER=
ERROR_EMAIL_ADDRESSES=

PROVER_ADDRESS="https://zkemail--email-wallet-relayer-v1-1-flask-app-dev.modal.run"

Expand Down
3 changes: 1 addition & 2 deletions packages/relayer/eml_templates/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@
margin-bottom: 15px;
"
>
Your email transaction failed due to the following error:
<span style="font-style: italic; font-weight: 600">{{errorMsg}}</span>
Your email transaction failed. Please try again later.
</p>
</td>
</tr>
Expand Down
Loading

0 comments on commit bd9552e

Please sign in to comment.