File: //proc/thread-self/root/opt/cpguard/app/resources/email_templates/services_alerts.html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1" />
<title>Service Alerts</title>
<style type="text/css">
body {
margin: 0 !important;
padding: 0;
min-width: 100%;
background-color: #F4F5F8;
font-family: -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir, Helvetica, sans-serif;
}
table td {
border-collapse: collapse;
}
img {
-ms-interpolation-mode: bicubic;
}
</style>
</head>
<body
style="margin:0;padding:0;min-width:100%;background-color:#F4F5F8;font-family:-apple-system,BlinkMacSystemFont,'Avenir Next',Avenir,Helvetica,sans-serif;">
<table align="center" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%"
style="margin:0 auto;">
<tr>
<td align="center" style="background:#f4f5f8;">
<!-- Header -->
<table bgcolor="#F4F5F8" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="600"
style="max-width:600px;">
<tr>
<td align="left" style="padding: 20px;">
<table width="100%">
<tr>
<td>
<a href="https://www.opsshield.com" target="_blank">
<img alt="cPGuard"
src="https://opsshield.com/assets/mail/logo_color.png"
style="width:40%;display:block;border:none;" />
</a>
</td>
<td align="right"
style="text-align:right;font-size:16px;color:#999;font-weight:400;">
<a href="https://{{hostname}}"
style="color:#999;text-decoration:none;">{{hostname}}</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- Alert Box -->
<table align="center" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="600"
style="max-width:600px;overflow:hidden;">
<tr>
<td
style="background:linear-gradient(135deg,#dc2626 0%,#ea4335 100%);padding:32px;text-align:center;">
<h1 style="color:#fff;font-size:26px;font-weight:bold;margin:0 0 8px 0;">
Critical {{ failure_count == 1 ?'Service' : 'Services' }} down
</h1>
</td>
</tr>
<tr>
<td style="padding:22px;">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="52" align="top" align="center" valign="middle" style="font-size:32px">
⏰
</td>
<td valign="middle" style="padding-left:15px;">
<h2 style="font-size:22px;font-weight:700;color:#92400e;letter-spacing:0.3px;">
Immediate Action Required
</h2>
<div style="font-size:18px;line-height:1.6;color:#78350f;margin-top:5px;">
The affected service(s) may be impacting website availability.
Please investigate and resolve as soon as possible.
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr align="left" style="margin-bottom:20px; ;">
<td style="padding:22px;">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="52" align="top" align="center" valign="middle" style="font-size:32px">
</td>
<td valign="middle" style="padding-left:15px;padding-bottom:40px;">
<a href="{{app_url}}/services"
style="background-color:#4285f4;margin:0;text-decoration:none;font-family:Roboto,Arial,sans-serif;font-weight:bold;font-size:16px;color:#ffffff;display:inline-block;border-radius:4px"
target="_blank"
data-saferedirecturl="https://www.google.com/url?q={{app_url}}/services&source=gmail&ust=1761806569115000&usg=AOvVaw3rGMnpIS5UVUIJzEUmCRDr">
<span
style="display:block;width:158px!important;line-height:40px;text-align:center">Open
cpGuard</span>
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- Service Status Overview -->
<table align="center" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="600"
style="max-width:600px;margin-top:20px;padding:0 20px 20px 20px;">
<tr>
<td>
<h3 style="text-align:left;font-size:18px;">📊 Service Status</h3>
{% macro service_table(service, info) %}
{% set status = info.status|lower %}
{% set icon = status == 'running' ? '🟢'
: (status == 'down' ? '🔴'
: (status == 'disabled' or status == 'misconfigured' ? '🟡' : '⚪')) %}
{% if status == 'running' %}
{% set border_color = '#4caf5052' %}
{% set border_color_row = '#edffef' %}
{% set border_color_fill = '#f6fff7' %}
{% set status_bg = '#4caf50' %}
{% set status_text = '#ffffff' %}
{% elseif status == 'down' %}
{% set border_color = '#ea433552' %}
{% set border_color_row = '#f5f5f5' %}
{% set border_color_fill = '#fcffea' %}
{% set status_bg = '#ea4335' %}
{% set status_text = '#ffffff' %}
{% elseif status == 'disabled' or status == 'misconfigured' %}
{% set border_color = '#ffeb3b52' %}
{% set border_color_row = '#fdffd2' %}
{% set border_color_fill = '#fcffea' %}
{% set status_bg = '#ffeb3b' %}
{% set status_text = '#000000' %}
{% else %}
{% set border_color = '#cccccc' %}
{% set border_color_row = '#eeeeee' %}
{% set border_color_fill = '#f9f9f9' %}
{% set status_bg = '#ffffff' %}
{% set status_text = '#000000' %}
{% endif %}
<!-- Down -->
<table width="100%" cellpadding="10" cellspacing="0"
style="margin-top:20px;border:2px solid {{ border_color }};background:{{border_color_fill}};border-radius:10px;margin-bottom:12px;">
<tr>
<td width="50" align="center" valign="middle"
style="background:{{border_color_row}};border-radius:8px;">
{{ icon }}
</td>
<td valign="middle" style="font-size:14px;">
<strong>{{ service|capitalize }}</strong><br />
<span style="font-size:13px;color:#555;">{{ info.error }}</span><br />
<span style="font-size:13px;color:#555;">{{ info.reason }}</span>
</td>
<td align="right" valign="middle">
<span
style="display:inline-block;padding:6px 12px;background:{{status_bg}};color:{{status_text}};border-radius:20px;font-size:13px;font-weight:600;">
{{ status|upper }}
</span>
</td>
</tr>
</table>
{% endmacro %}
{% import _self as macros %}
{# Render DOWN services first #}
{% for service, info in data.services %}
{% if info.status|lower == 'down' %}
{{ macros.service_table(service, info) }}
{% endif %}
{% endfor %}
{# Render WARNING services next #}
{% for service, info in data.services %}
{% if info.status|lower in ['disabled', 'misconfigured'] %}
{{ macros.service_table(service, info) }}
{% endif %}
{% endfor %}
{# Render RUNNING services last #}
{% for service, info in data.services %}
{% if info.status|lower == 'running' %}
{{ macros.service_table(service, info) }}
{% endif %}
{% endfor %}
<!-- Host Info -->
<table width="100%" cellpadding="8" cellspacing="0"
style="margin-top:30px;border-radius:8px;font-size:14px;">
<tr>
<td>Host Name:</td>
<td align="right">{{hostname|e}}</td>
</tr>
<tr>
<td>IP Address:</td>
<td align="right">{{client_ip}}</td>
</tr>
<tr>
<td>Alert Triggered At:</td>
<td align="right">{{ date_string|date('F j, Y, g:i a') }}</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- Footer -->
<table align="center" bgcolor="#F4F5F8" border="0" cellpadding="0" cellspacing="0" width="600"
style="margin-top:40px;margin-bottom:40px;">
<tr>
<td align="center" style="padding:20px;">
<span style="font-size:12px;line-height:1.6;color:#999999;">
You've received this email because you have cPGuard security on your server -
{{hostname}}.<br />
You may turn off notifications from
<a href="https://{{hostname}}" style="color:#999999;font-weight:500;">cPGuard
settings</a>.
</span>
</td>
</tr>
<tr>
<td>
<a href="https://www.opsshield.com">
<img height="46" alt="OpsShield logo"
src="https://www.opsshield.com/assets/img/opsshield-logo.png"
style="margin-bottom:10px;border:none;" />
</a>
<div style="margin-top:10px;float:right">
<a href="https://x.com/opsshieldllp" style="margin:0 10px;"><img height="27" width="27"
alt="X" src="https://opsshield.com/assets/img/twitter.png" /></a>
<a href="https://www.facebook.com/opsshield" style="margin:0 10px;"><img height="32"
width="32" alt="fb" src="https://opsshield.com/assets/img/facebook.png" /></a>
</div>
<div style="margin-top:15px;font-size:12px;color:#999999;">
<a href="https://www.opsshield.com/blog/"
style="color:#696969;text-decoration:none;">Our Blog</a> |
<a href="https://opsshield.com/privacy-policy.html"
style="color:#696969;text-decoration:none;">Privacy Policy</a> |
<a href="https://opsshield.com/help/" style="color:#696969;text-decoration:none;">Help
Center</a>
</div>
<div style="margin-top:10px;font-size:12px;color:#999999;">© 2025 OpsShield LLP. All rights
reserved.</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>