Email Alerts Including Graphs

Hello Folks,

I’ve been wrestling this morning trying to include processor graphs with email alerts but i’ve hit a bit of a brick wall

Every time the alert email comes through it’s missing the actual graph!

See below:

I’ve added the following line to my config already

$config[‘allow_unauth_graphs’] = true;

My Alert template is as follows:

{{ $alert->title }} <br>
Severity: {{ $alert->severity }}  <br>
@if ($alert->state == 0) Time elapsed: {{ $alert->elapsed }} @endif
Timestamp: {{ $alert->timestamp }} <br>
Rule: @if ($alert->name) {{ $alert->name }} @else {{ $alert->rule }} @endif <br>
@if ($alert->faults) Faults:
@foreach ($alert->faults as $key => $value)
{{ $key }}: {{ $value['string'] }}<br>
@endforeach 
@if ($alert->faults) <b>Faults:</b><br>
@foreach ($alert->faults as $key => $value)<img src=https://bubble.shef.ac.uk/graph.php?device= 
{{$value['device_id']}}&type=device_processor&width=459&height=213&lazy_w=552&from=end-72h><br>
https://bubble.shef.ac.uk/graphs/device={{$value['device_id']}}/type=device_processor/ <br>
@endforeach 
@endif
@endif

Is anyone able to advise why this may be happening?

Do you have double quotes around your img src URL ? Can the email client access the direct graph link if it’s behind a firewall etc?

  • Quote around https link (as mentioned)
  • possibly a space after "…php?device= " … could be from post
  • second link needs to also be encapsulated with

<img src="YOURLINKHERE">