docs/operator-manual/notifications/services/googlechat.md
The Google Chat notification service send message notifications to a google chat webhook. This service uses the following settings:
webhooks - a map of the form webhookName: webhookUrlGoogle chat and go to the space to which you want to send messagesargocd-notification-secret and declare it in argocd-notifications-cmapiVersion: v1
kind: ConfigMap
metadata:
name: argocd-notifications-cm
data:
service.googlechat: |
webhooks:
spaceName: $space-webhook-url
apiVersion: v1
kind: Secret
metadata:
name: <secret-name>
stringData:
space-webhook-url: https://chat.googleapis.com/v1/spaces/<space_id>/messages?key=<key>&token=<token>
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
annotations:
notifications.argoproj.io/subscribe.on-sync-succeeded.googlechat: spaceName
You can send simple text or card messages to a Google Chat space. A simple text message template can be defined as follows:
template.app-sync-succeeded: |
message: The app {{ .app.metadata.name }} has successfully synced!
A card message can be defined as follows:
template.app-sync-succeeded: |
googlechat:
cardsV2: |
- header:
title: ArgoCD Bot Notification
sections:
- widgets:
- decoratedText:
text: The app {{ .app.metadata.name }} has successfully synced!
- widgets:
- decoratedText:
topLabel: Repository
text: {{ call .repo.RepoURLToHTTPS .app.spec.source.repoURL }}
- decoratedText:
topLabel: Revision
text: {{ .app.spec.source.targetRevision }}
- decoratedText:
topLabel: Author
text: {{ (call .repo.GetCommitMetadata .app.status.sync.revision).Author }}
All Card fields are supported and can be used
in notifications. It is also possible to use the previous (now deprecated) cards key to use the legacy card fields,
but this is not recommended as Google has deprecated this field and recommends using the newer cardsV2.
The card message can be written in JSON too.
It is possible send both simple text and card messages in a chat thread by specifying a unique key for the thread. The thread key can be defined as follows:
template.app-sync-succeeded: |
message: The app {{ .app.metadata.name }} has successfully synced!
googlechat:
threadKey: {{ .app.metadata.name }}