• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / blurts-server / #12508

pending completion
#12508

push

circleci

web-flow
Merge pull request #2860 from mozilla/MNTOR-1258-Sign-up-email-undefined

Fix sign-up email template for emails with no breaches

282 of 1387 branches covered (20.33%)

Branch coverage included in aggregate %.

6 of 6 new or added lines in 4 files covered. (100.0%)

959 of 3746 relevant lines covered (25.6%)

2.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/views/emails/email-breach-card.js
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4

5
import { getLocale, getMessage } from '../../utils/fluent.js'
6
import { formatDate } from '../../utils/format-date.js'
7

8
const breachAlertTableStyle = `
×
9
  margin: auto
10
`
11

12
const breachAlertCardsContainerStyle = `
×
13
  background: white;
14
  border-radius: 6px;
15
  border-spacing: 0;
16
  border: 1px solid #eeeeee;
17
  box-shadow: 0 0 6px #dddddd;
18
  display: inline-table;
19
  margin: 12px;
20
  min-width: 240px;
21
  width: 30%;
22
`
23

24
const breachAlertCardsTitleStyle = `
×
25
  background: #eeeeee;
26
  border-top-left-radius: 6px;
27
  border-top-right-radius: 6px;
28
  padding: 12px;
29
`
30

31
const breachAlertCardsTitleImageStyle = `
×
32
  vertical-align: bottom;
33
`
34

35
const breachAlertLabelStyle = `
×
36
  color: #5e5e72;
37
  font-family: sans-serif;
38
  font-size: 13px;
39
  font-weight: 300;
40
  margin: 0px;
41
  padding-bottom: 4px;
42
`
43

44
const breachAlertValueStyle = `
×
45
  color: #20123a;
46
  font-family: sans-serif;
47
  font-size: 15px;
48
  font-weight: 600;
49
  margin: 0px;
50
  padding-bottom: 15px;
51
`
52

53
const breachCardPartial = breachData => {
×
54
  const {
55
    LogoPath,
56
    AddedDate,
57
    DataClasses,
58
    Title
59
  } = breachData
×
60

61
  return `
×
62
    <table style='${breachAlertTableStyle}'>
63
      <tr>
64
        <td>
65
          <table style='${breachAlertCardsContainerStyle}'>
66
            <tr>
67
              <td style='${breachAlertCardsTitleStyle}'>
68
                <img
69
                  height='25'
70
                  src='${LogoPath}'
71
                  style='${breachAlertCardsTitleImageStyle}'
72
                  width='25'
73
                >
74
                ${Title}
75
              </td>
76
            </tr>
77
            <tr>
78
              <td style='padding: 24px;'>
79
                <p style='${breachAlertLabelStyle}'>
80
                  ${getMessage('breach-added-label')}
81
                </p>
82
                <p style='${breachAlertValueStyle}'>
83
                  ${formatDate(AddedDate, getLocale())}
84
                </p>
85

86
                ${DataClasses?.length
×
87
                  ? `
88
                      <p style='${breachAlertLabelStyle}'>
89
                        ${getMessage('compromised-data')}
90
                      </p>
91
                      <span style='${breachAlertValueStyle}'>
92
                        ${DataClasses.map(classKey => getMessage(classKey))
×
93
                          .join(', ')
94
                          .trim()}
95
                      </span>
96
                    `
97
                  : ''}
98
              </td>
99
            </tr>
100
          </table>
101
        </td>
102
      </tr>
103
    </table>
104
  `
105
}
106

107
export { breachCardPartial }
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc