Skip to content

Commit c0cf6e6

Browse files
emma-sgikreymer
andauthored
update docs nav with emails page (#2794)
Quick follow-up to #1375. Makes email dev docs visible. --------- Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
1 parent d6cce19 commit c0cf6e6

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

frontend/docs/docs/develop/emails.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,53 @@ To view and edit email templates, you can run the React Email development server
66

77
```sh
88
cd emails
9-
npm run dev
9+
```
10+
```sh
11+
yarn install
12+
```
13+
```sh
14+
yarn dev
1015
```
1116

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).
1318

1419
Templates themselves are located in the `emails` directory.
1520

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
1724

1825
Email sending can be tested locally with a tool such as [smtp4dev](https://github.com/rnwood/smtp4dev).
1926

2027
If you have previously deployed the Browsertrix backend, you'll need to make some changes to your `chart/local.yaml`:
2128

2229
1. Update your `chart/local.yaml` to include the new service:
23-
```diff
30+
```yaml hl_lines="3 8"
2431
# use version specified in values.yaml, uncomment to use :latest release instead
2532
backend_image: docker.io/webrecorder/browsertrix-backend:latest
26-
+emails_image: docker.io/webrecorder/browsertrix-emails:latest
33+
emails_image: docker.io/webrecorder/browsertrix-emails:latest
2734
frontend_image: docker.io/webrecorder/browsertrix-frontend:latest
2835

2936
# overrides to use existing images in local Docker, otherwise will pull from repository
3037
backend_pull_policy: "Never"
31-
+emails_pull_policy: "Never"
38+
emails_pull_policy: "Never"
3239
frontend_pull_policy: "Never"
3340
```
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
4350
```
4451
3. Build the updated backend and new emails images:
4552
```sh
4653
./scripts/build-backend.sh
54+
```
55+
```sh
4756
./scripts/build-emails.sh
4857
```
4958
4. Deploy the changes you've made:
@@ -58,6 +67,6 @@ If you're using Docker Desktop or a similar Docker-compatible Kubernetes runtime
5867
docker run --rm -it -p 5000:80 -p 2525:25 rnwood/smtp4dev
5968
```
6069

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).
6271

6372
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.

frontend/docs/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ nav:
9494
- develop/index.md
9595
- develop/local-dev-setup.md
9696
- develop/docs.md
97+
- develop/emails.md
9798
- UI Development:
9899
- develop/frontend-dev.md
99100
- develop/ui/components.md

0 commit comments

Comments
 (0)