How do notification templates work in Alertmanager?

IntermediateConceptAlertmanager & Alerting
Answer

Receivers use Go templates over the grouped alert data (.Status, .CommonLabels, .CommonAnnotations, .Alerts):

receivers:
  - name: payments-slack
    slack_configs:
      - channel: "#payments-alerts"
        send_resolved: true
        title: '[{{ .Status | toUpper }}] {{ .CommonLabels.alertname }}'
        text: >-
          {{ range .Alerts }}*{{ .Labels.instance }}*: {{ .Annotations.summary }}
          Runbook: {{ .Annotations.runbook_url }}
          {{ end }}

Shared templates live in files listed under templates:.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Alertmanager & Alerting