Converting alerts

I’m trying to convert my existing alerting templates to the new format and am absolutely stuck trying to get them to be accepted. They’re all fairly similar so I’m figuring if I can get some direction on where I’m going wrong with one of them I should be able to get the rest to work. Here’s the one that I use for device up/down (after running through the convert):

@if ($alert->transport == mail) <b>{{ $alert->title }}</b><br>
<b>Severity:</b> {{ $alert->severity }}<br>
@if ($alert->state == 0) <b>Time elapsed:</b> {{ $alert->elapsed }}<br> @endif 
<b>Timestamp:</b> {{ $alert->timestamp }}<br>
<b>Rule:</b>  @if ($alert->name) {{ $alert->name }} @else {{ $alert->rule }} @endif <br>
@if ($alert->faults) <b>Faults:</b> 
{{ $alert->hostname }} is  @if ($alert->state == 1) down @else up @endif <br> @endif 
<b>Alert sent to:</b>  @foreach ($alert->contacts as $key => $value){{ $value }} <{{ $key }}>      @endforeach 
@if ($alert->transport == msteams) 
@if ($alert->state == 0) Time elapsed: {{ $alert->elapsed }} @endif   
Timestamp: {{ $alert->timestamp }}  
@if ($alert->faults) Faults: {{ $alert->hostname }} is  @if ($alert->state == 1) down @else up @endif  @endif 

I get a syntax error alert when trying to save the template but no other real guidance. I’ve got through the new documentation and the linked Laravel documentation and I can’t see anything glaring that I’m doing wrong. I’m sure it’s something fairly simple that I’m just overlooking.

I’m not 100% sure why although it might because we don’t pass any placeholders over to the template which means this then results in a blank template itself. Add a line before @if ($alert->transport == mail) <b>{{ $alert->title }}</b><br> like Alerts:

That did the trick, just needed to have something in front of the @if