mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Email Transport: embed graphs by default (#14270)
* Email embed graphs * Allow attachment for non-html Add setting to webui Correct $auth setting * Cleanups, throw RrdGraphException instead of returning an error image. Generate the error image later, giving more control. Reduce code duplication a little * Style and lint fixes Change to flags * Add baseline for lint errors I don't know how to resolve * oopsie, changed the code after generating the baseline * Tiny cleanups. Make set DeviceCache primary, it is free. * Docs. * email_html note * Allow control of graph embed at the email transport level to override the global config. * Allow control of graph embed at the email transport level to override the global config. * Add INLINE_BASE64 to make it easier to create inline image tags
This commit is contained in:
@@ -46,7 +46,7 @@ class Mail extends Transport
|
||||
$msg = preg_replace("/(?<!\r)\n/", "\r\n", $obj['msg']);
|
||||
}
|
||||
|
||||
return \LibreNMS\Util\Mail::send($email, $obj['title'], $msg, $html);
|
||||
return \LibreNMS\Util\Mail::send($email, $obj['title'], $msg, $html, $this->config['attach-graph'] ?? null);
|
||||
}
|
||||
|
||||
public static function configTemplate()
|
||||
@@ -59,6 +59,13 @@ class Mail extends Transport
|
||||
'descr' => 'Email address of contact',
|
||||
'type' => 'text',
|
||||
],
|
||||
[
|
||||
'title' => 'Include Graphs',
|
||||
'name' => 'attach-graph',
|
||||
'descr' => 'Include graph image data in the email. Will be embedded if html5, otherwise attached. Template must use @signedGraphTag',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
],
|
||||
],
|
||||
'validation' => [
|
||||
'email' => 'required|email',
|
||||
|
Reference in New Issue
Block a user