Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
docs: document email service integration (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Matyushentsev authored and alexmt committed Jan 19, 2021
1 parent fae5f32 commit ea32243
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 16 deletions.
27 changes: 11 additions & 16 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,29 @@ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj-labs/argoc
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj-labs/argocd-notifications/release-1.0/catalog/install.yaml
```

* Configure Slack integration

```bash
kubectl apply -n argocd -f - << EOF
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-notifications-cm
data:
service.slack: |
token: $slack-token
EOF
```

* Add Slack token to `argocd-notifications-secret` secret
* Add Email username and password token to `argocd-notifications-secret` secret

```bash
export EMAIL_USER=<your-username>
export PASSWORD=<your-password>
kubectl apply -n argocd -f - << EOF
apiVersion: v1
kind: Secret
metadata:
name: argocd-notifications-secret
stringData:
slack-token: <my-slack-token>
email-username: $EMAIL_USER
email-password: $PASSWORD
type: Opaque
EOF
```

* Register Email notification service

```bash
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 }" }}'
```

* Subscribe to notifications by adding the `notifications.argoproj.io/subscribe.on-sync-succeeded.slack` annotation to the Argo CD application or project:

```bash
Expand Down
47 changes: 47 additions & 0 deletions docs/services/email.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Email

## Parameters

The Email notification service sends email notifications using SMTP protocol and requires specifying the following settings:

* `host` - the SMTP server host name
* `port` - the SMTP server port
* `username` - username
* `password` - password
* `from` - from email address

## Example

The following snippet contains sample Gmail service configuration:

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-notifications-cm
data:
service.email.gmail: |
username: $email-username
password: $email-password
host: smtp.gmail.com
port: 465
from: $email-username
```
## Template
Notification templates support specifying subject for email notifications:
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-notifications-cm
data:
template.app-sync-succeeded: |
email:
subject: Application {{.app.metadata.name}} has been successfully synced.
message: |
{{if eq .serviceType "slack"}}:white_check_mark:{{end}} Application {{.app.metadata.name}} has been successfully synced at {{.app.status.operationState.finishedAt}}.
Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true .
```
1 change: 1 addition & 0 deletions docs/services/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ that leverages [Mattermost](https://mattermost.com/):

## Service Types

* [Email](./email.md)
* [Slack](./slack.md)
* [Opsgenie](./opsgenie.md)
* [Grafana](./grafana.md)
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ nav:
- subscriptions.md
- Notification Services:
- services/overview.md
- services/email.md
- services/slack.md
- services/opsgenie.md
- services/grafana.md
Expand Down

0 comments on commit ea32243

Please sign in to comment.