Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

Commit ea32243

Browse files
Alexander Matyushentsevalexmt
authored andcommitted
docs: document email service integration (#152)
1 parent fae5f32 commit ea32243

4 files changed

Lines changed: 60 additions & 16 deletions

File tree

docs/index.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,29 @@ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj-labs/argoc
2020
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj-labs/argocd-notifications/release-1.0/catalog/install.yaml
2121
```
2222

23-
* Configure Slack integration
24-
25-
```bash
26-
kubectl apply -n argocd -f - << EOF
27-
apiVersion: v1
28-
kind: ConfigMap
29-
metadata:
30-
name: argocd-notifications-cm
31-
data:
32-
service.slack: |
33-
token: $slack-token
34-
EOF
35-
```
36-
37-
* Add Slack token to `argocd-notifications-secret` secret
23+
* Add Email username and password token to `argocd-notifications-secret` secret
3824

3925
```bash
26+
export EMAIL_USER=<your-username>
27+
export PASSWORD=<your-password>
4028
kubectl apply -n argocd -f - << EOF
4129
apiVersion: v1
4230
kind: Secret
4331
metadata:
4432
name: argocd-notifications-secret
4533
stringData:
46-
slack-token: <my-slack-token>
34+
email-username: $EMAIL_USER
35+
email-password: $PASSWORD
4736
type: Opaque
4837
EOF
4938
```
5039

40+
* Register Email notification service
41+
42+
```bash
43+
kubectl patch cm argocd-notifications-cm -n argocd --type merge -p '{"data": {"service.email.gmail": "{ username: $email-username, password: $email-password, host: smtp.gmail.com, port: 465, from: $email-username }" }}'
44+
```
45+
5146
* Subscribe to notifications by adding the `notifications.argoproj.io/subscribe.on-sync-succeeded.slack` annotation to the Argo CD application or project:
5247

5348
```bash

docs/services/email.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Email
2+
3+
## Parameters
4+
5+
The Email notification service sends email notifications using SMTP protocol and requires specifying the following settings:
6+
7+
* `host` - the SMTP server host name
8+
* `port` - the SMTP server port
9+
* `username` - username
10+
* `password` - password
11+
* `from` - from email address
12+
13+
## Example
14+
15+
The following snippet contains sample Gmail service configuration:
16+
17+
```yaml
18+
apiVersion: v1
19+
kind: ConfigMap
20+
metadata:
21+
name: argocd-notifications-cm
22+
data:
23+
service.email.gmail: |
24+
username: $email-username
25+
password: $email-password
26+
host: smtp.gmail.com
27+
port: 465
28+
from: $email-username
29+
```
30+
31+
## Template
32+
33+
Notification templates support specifying subject for email notifications:
34+
35+
```yaml
36+
apiVersion: v1
37+
kind: ConfigMap
38+
metadata:
39+
name: argocd-notifications-cm
40+
data:
41+
template.app-sync-succeeded: |
42+
email:
43+
subject: Application {{.app.metadata.name}} has been successfully synced.
44+
message: |
45+
{{if eq .serviceType "slack"}}:white_check_mark:{{end}} Application {{.app.metadata.name}} has been successfully synced at {{.app.status.operationState.finishedAt}}.
46+
Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true .
47+
```

docs/services/overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ that leverages [Mattermost](https://mattermost.com/):
3030

3131
## Service Types
3232

33+
* [Email](./email.md)
3334
* [Slack](./slack.md)
3435
* [Opsgenie](./opsgenie.md)
3536
* [Grafana](./grafana.md)

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ nav:
3232
- subscriptions.md
3333
- Notification Services:
3434
- services/overview.md
35+
- services/email.md
3536
- services/slack.md
3637
- services/opsgenie.md
3738
- services/grafana.md

0 commit comments

Comments
 (0)