"Alert sent to" always empty

i use different transports in my alerts (through operations menu), some e-mail some telegram
My question is, why “Alert sent to:” is always empty in my alerts?
I use the following flow in most of my alert templates:
``@foreach ($alert->contacts as $key => $value){{ $value }} <{{ $key }}>@endforeach``
I am using Docker build 26.4.1, but I have the issue since I first deployed LibreNMS some years ago

The code you showed simply prints the contacts in the email.

You need to add an alert transport and set who it should be sent to.

Sorry, I think I am missing something.
I have set multiple transports on the transports page and I have created multiple templates, for example:


{{ $alert->title }} @if ($alert->state == 1) @if ($alert->severity == 'critical')❗@elseif ($alert->severity == 'warning') ⚠️ @endif
@endif
@if ($alert->state == 0) Duration: {{ $alert->elapsed }} @else Severity: {{ $alert->severity }} @endif
@if ($alert->name) {{ $alert->name }} @else {{ $alert->rule }} @endif

@if ($alert->faults) Faults:
@foreach ($alert->faults as $key => $value)

Description: {{ $value['customoid_descr'] }} Current: {{ $value['customoid_current'] }} Previous: {{ $value['customoid_prev'] }} Warning Threshold: {{ $value['customoid_limit_warn'] }} Critical Threshold: {{ $value['customoid_limit'] }} Warning Low Threshold: {{ $value['customoid_limit_low_warn'] }} Critical Low Threshold: {{ $value['customoid_limit_low'] }}
@endforeach
@endif

Timestamp: {{ $alert->timestamp }}
Alert sent to:
@foreach ($alert->contacts as $key => $value)
{{ $value }} <{{ $key }}>
@endforeac

In my initial post I only included the snippet of my templates including the contacts.

Oh, contacts is a very specific legacy field. I think it may only have email addresses in some very specific situations. I would have to look at the code.