apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-notifications-cm
data:
  config.yaml: |
    subscriptions:
    # global subscription for all type of notifications
    - recipients:
      - slack:test1
      - webhook:github
    # subscription for on-sync-status-unknown trigger notifications
    - recipients:
      - slack:test2
      - email:test@gmail.com
      trigger: on-sync-status-unknown
    # global subscription restricted to applications with matching labels only
    - recipients:
      - slack:test3
      selector: test=true
    triggers:
      # Enable existing built-in trigger
      - name: on-sync-status-unknown
        enabled: true
      # Define your custom trigger
      - name: my-custom-trigger
        condition: app.status.sync.status == 'Unknown'
        template: my-custom-template
    templates:
      # Add your custom template
      - name: my-custom-template
        title: Hello {{.app.metadata.name}}
        body: |
          Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}.
      # Override one field in built-in template
      - name: on-sync-succeeded
        title: Application {{.app.metadata.name}} sync status is {{.app.status.sync.status}}
