mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-11-04 11:22:10 +08:00 
			
		
		
		
	feat: update alert email template
This commit is contained in:
		
							parent
							
								
									01f62c8baf
								
							
						
					
					
						commit
						643ed9c8e7
					
				@ -1,8 +1,10 @@
 | 
			
		||||
{{ define "email.to.html" }}
 | 
			
		||||
{{ range .Alerts }}
 | 
			
		||||
<!-- Begin of OpenIM Alert -->
 | 
			
		||||
<div style="border:1px solid #ccc; padding:10px; margin-bottom:10px;">
 | 
			
		||||
{{ if eq .Status "firing" }}
 | 
			
		||||
    {{ range .Alerts }}
 | 
			
		||||
    <!-- Begin of OpenIM Alert -->
 | 
			
		||||
    <div style="border:1px solid #ccc; padding:10px; margin-bottom:10px;">
 | 
			
		||||
        <h3>OpenIM Alert</h3>
 | 
			
		||||
        <p><strong>Alert Status:</strong> firing</p>
 | 
			
		||||
        <p><strong>Alert Program:</strong> Prometheus Alert</p>
 | 
			
		||||
        <p><strong>Severity Level:</strong> {{ .Labels.severity }}</p>
 | 
			
		||||
        <p><strong>Alert Type:</strong> {{ .Labels.alertname }}</p>
 | 
			
		||||
@ -10,7 +12,25 @@
 | 
			
		||||
        <p><strong>Affected Service:</strong> {{ .Labels.job }}</p>
 | 
			
		||||
        <p><strong>Alert Subject:</strong> {{ .Annotations.summary }}</p>
 | 
			
		||||
        <p><strong>Trigger Time:</strong> {{ .StartsAt.Format "2006-01-02 15:04:05" }}</p>
 | 
			
		||||
</div>
 | 
			
		||||
    </div>
 | 
			
		||||
    {{ end }}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{{ else if eq .Status "resolved" }}
 | 
			
		||||
    {{ range .Alerts }}
 | 
			
		||||
    <!-- Begin of OpenIM Alert -->
 | 
			
		||||
    <div style="border:1px solid #ccc; padding:10px; margin-bottom:10px;">
 | 
			
		||||
        <h3>OpenIM Alert</h3>
 | 
			
		||||
        <p><strong>Alert Status:</strong> resolved</p>
 | 
			
		||||
        <p><strong>Alert Program:</strong> Prometheus Alert</p>
 | 
			
		||||
        <p><strong>Severity Level:</strong> {{ .Labels.severity }}</p>
 | 
			
		||||
        <p><strong>Alert Type:</strong> {{ .Labels.alertname }}</p>
 | 
			
		||||
        <p><strong>Affected Host:</strong> {{ .Labels.instance }}</p>
 | 
			
		||||
        <p><strong>Affected Service:</strong> {{ .Labels.job }}</p>
 | 
			
		||||
        <p><strong>Alert Subject:</strong> {{ .Annotations.summary }}</p>
 | 
			
		||||
        <p><strong>Trigger Time:</strong> {{ .StartsAt.Format "2006-01-02 15:04:05" }}</p>
 | 
			
		||||
    </div>
 | 
			
		||||
    {{ end }}
 | 
			
		||||
<!-- End of OpenIM Alert -->
 | 
			
		||||
{{ end }}
 | 
			
		||||
{{ end }}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user