Error when templating grafana alerts

I am trying to template a grafana alert:

{{ define "template" }}
host {{ .Labels.alertname }} has been caused by {{ .Labels.host }} 
{{ .Annotations.Summary }}
{{ end }}

sc

But the alert is only sent up to the first label
sc3

This is the error log:

logger=alerting.notifier.slack level=error msg="Missing receiver"
logger=alerting.notifier.slack level=error msg="Missing group labels"
logger=alerting.notifier.slack lvl=warn msg="failed to template Slack message" err="template: template:3:15: executing \"template\" at <.Labels.alertname>: can't evaluate field Labels in type *channels.ExtendedData"

If I remove the template, the alert works fine

Any ideas what could cause this?
Thanks

Can you confirm: are you using the new Grafana Alerting platform (first released in Grafana 8) or the legacy alerting platform? I should note that the legacy platform is no longer actively developed:

https://grafana.com/docs/grafana/next/alerting/migrating-alerts/

I am using the new Grafana Alerting platform