mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
feat: health rating color in email (#8943)
This commit is contained in:
parent
3a0cddc345
commit
23bdf0356a
@ -174,6 +174,7 @@ test('Can send productivity report email', async () => {
|
||||
expect(content.html.includes(`Productivity Report`)).toBe(true);
|
||||
expect(content.html.includes(`localhost/insights`)).toBe(true);
|
||||
expect(content.html.includes(`localhost/profile`)).toBe(true);
|
||||
expect(content.html.includes(`#b0d182`)).toBe(true);
|
||||
expect(content.text.includes(`localhost/insights`)).toBe(true);
|
||||
expect(content.text.includes(`localhost/profile`)).toBe(true);
|
||||
});
|
||||
|
@ -542,6 +542,16 @@ export class EmailService {
|
||||
userEmail,
|
||||
...metrics,
|
||||
unleashUrl: this.config.server.unleashUrl,
|
||||
healthColor() {
|
||||
const healthRating = this.health;
|
||||
const healthColor =
|
||||
healthRating >= 0 && healthRating <= 24
|
||||
? '#d93644'
|
||||
: healthRating >= 25 && healthRating <= 74
|
||||
? '#ffc46f'
|
||||
: '#b0d182';
|
||||
return healthColor;
|
||||
},
|
||||
};
|
||||
|
||||
const template = 'productivity-report';
|
||||
|
@ -27,7 +27,7 @@
|
||||
<div class="shaded"
|
||||
style="margin: 0;padding: 36px 8px;background: #f0f0f5;border-width: 3px;border-color: #ffffff;border-style: solid;">
|
||||
<div style="padding-top: 12px;">
|
||||
<span style="color: #1a4049;">{{health}}%</span><br>
|
||||
<span style="color: {{healthColor}};">{{health}}%</span><br>
|
||||
<span style="font-size: 16px; color: #888;">your instance health</span>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user