You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: frontend/docs/docs/develop/emails.md
+25-16Lines changed: 25 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,44 +6,53 @@ To view and edit email templates, you can run the React Email development server
6
6
7
7
```sh
8
8
cd emails
9
-
npm run dev
9
+
```
10
+
```sh
11
+
yarn install
12
+
```
13
+
```sh
14
+
yarn dev
10
15
```
11
16
12
-
You can then view the email templates in your browser at [http://localhost:3000](http://localhost:3000).
17
+
You can then view the email templates in your browser at [localhost:3000](http://localhost:3000).
13
18
14
19
Templates themselves are located in the `emails` directory.
15
20
16
-
## Testing Email Sending
21
+
You can also send test emails from the development server using a service provided by Resend with the **Send** button in the top right corner when viewing an email template.
22
+
23
+
## Testing Email Sending from Browsertrix
17
24
18
25
Email sending can be tested locally with a tool such as [smtp4dev](https://github.com/rnwood/smtp4dev).
19
26
20
27
If you have previously deployed the Browsertrix backend, you'll need to make some changes to your `chart/local.yaml`:
21
28
22
29
1. Update your `chart/local.yaml` to include the new service:
23
-
```diff
30
+
```yaml hl_lines="3 8"
24
31
# use version specified in values.yaml, uncomment to use :latest release instead
# overrides to use existing images in local Docker, otherwise will pull from repository
30
37
backend_pull_policy: "Never"
31
-
+emails_pull_policy: "Never"
38
+
emails_pull_policy: "Never"
32
39
frontend_pull_policy: "Never"
33
40
```
34
-
2. If you'd like to view emails in a service such as [smtp4dev](https://github.com/rnwood/smtp4dev) locally (see [Using smtp4dev](#using-smtp4dev)), rather than just viewing emails in pod logs, update your `chart/local.yaml` to include email sending options:
35
-
```diff
36
-
+email:
37
-
+ smtp_host: "host.docker.internal"
38
-
+ smtp_port: 2525
39
-
+ sender_email: example@example.com
40
-
+ password: password
41
-
+ reply_to_email: example@example.com
42
-
+ use_tls: false
41
+
2. If you'd like to test sending emails locally rather than just viewing emails in pod logs without using an external e-mail service, you can use the [smtp4dev](https://github.com/rnwood/smtp4dev) Docker image locally (see [Using smtp4dev](#using-smtp4dev)). To do so, update your `chart/local.yaml` to include email sending options:
42
+
```yaml hl_lines="1-7"
43
+
email:
44
+
smtp_host: "host.docker.internal"
45
+
smtp_port: 2525
46
+
sender_email: example@example.com
47
+
password: password
48
+
reply_to_email: example@example.com
49
+
use_tls: false
43
50
```
44
51
3. Build the updated backend and new emails images:
45
52
```sh
46
53
./scripts/build-backend.sh
54
+
```
55
+
```sh
47
56
./scripts/build-emails.sh
48
57
```
49
58
4. Deploy the changes you've made:
@@ -58,6 +67,6 @@ If you're using Docker Desktop or a similar Docker-compatible Kubernetes runtime
58
67
docker run --rm -it -p 5000:80 -p 2525:25 rnwood/smtp4dev
59
68
```
60
69
61
-
After a few seconds, you can then open http://localhost:3000.
70
+
After a few seconds, you can then open [localhost:5000](http://localhost:5000).
62
71
63
72
If you're using a different Kubernetes runtime (e.g. k3d, microk8s, etc) you may need to set `smtp_host` to something other than `host.docker.internal` in your `chart/local.yaml`, and you may also need to configure other options. k3d likely uses `host.k3d.internal`, and microk8s `10.0.1.1`, but double check with your Kubernetes runtime documentation.
0 commit comments