Skip to content

Commit ad5ac41

Browse files
committed
Add email templates to RPM.
Also add a test that templates compile and run with current code.
1 parent dd5b822 commit ad5ac41

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ rpm: build
7373
--package $(ARCHIVEDIR)/boulder-$(VERSION)-$(COMMIT_ID).x86_64.rpm \
7474
--description "Boulder is an ACME-compatible X.509 Certificate Authority" \
7575
--depends "libtool-ltdl" --maintainer "$(MAINTAINER)" \
76-
test/boulder-config.json sa/_db $(OBJECTS)
76+
test/boulder-config.json sa/_db data/ $(OBJECTS)

cmd/expiration-mailer/main_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ func TestSendNags(t *testing.T) {
129129
err = m.sendNags(cert, []*core.AcmeURL{})
130130
test.AssertNotError(t, err, "Not an error to pass no email contacts")
131131
test.AssertEquals(t, len(mc.Messages), 0)
132+
133+
templates, err := template.ParseGlob("../../data/*.template")
134+
test.AssertNotError(t, err, "Failed to parse templates")
135+
for _, template := range templates.Templates() {
136+
m.emailTemplate = template
137+
err = m.sendNags(cert, []*core.AcmeURL{})
138+
test.AssertNotError(t, err, "failed to send nag")
139+
}
132140
}
133141

134142
var n = bigIntFromB64("n4EPtAOCc9AlkeQHPzHStgAbgs7bTZLwUBZdR8_KuKPEHLd4rHVTeT-O-XV2jRojdNhxJWTDvNd7nqQ0VEiZQHz_AJmSCpMaJMRBSFKrKb2wqVwGU_NsYOYL-QtiWN2lbzcEe6XC0dApr5ydQLrHqkHHig3RBordaZ6Aj-oBHqFEHYpPe7Tpe-OfVfHd1E6cS6M1FZcD1NNLYD5lFHpPI9bTwJlsde3uhGqC0ZCuEHg8lhzwOHrtIQbS0FVbb9k3-tVTU4fg_3L_vniUFAKwuCLqKnS2BYwdq_mzSnbLY7h_qixoR7jig3__kRhuaxwUkRz5iaiQkqgc5gHdrNP5zw==")

data/production-email.template

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Hello,
2+
3+
Your certificate (or certificates) for the names listed below will expire in
4+
{{.DaysToExpiration}} days (on {{.ExpirationDate}}). Please make sure to renew
5+
your certificate before then, or visitors to your website will encounter errors.
6+
7+
{{.DNSNames}}
8+
9+
For any questions or support, please visit https://community.letsencrypt.org/.
10+
Unfortunately, we can't provide support by email.
11+
12+
If you want to stop receiving all email from this address, click
13+
|UNSUB:https://mandrillapp.com/unsub|.
14+
15+
Regards,
16+
The Let's Encrypt Team

data/staging-email.template

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Hello,
2+
3+
[ Note: This message is from the Let's Encrypt staging environment. It
4+
likely is not relevant to any live web site. ]
5+
6+
You issued a testing cert (not a live one) from Let's Encrypt staging
7+
environment. This mail takes the place of what would normally be a renewal
8+
reminder, but instead is demonstrating delivery of renewal notices. Have a nice
9+
day!
10+
11+
Details:
12+
DNS Names: {{.DNSNames}}
13+
Expiration Date: {{.ExpirationDate}})
14+
Days to Expiration: {{.DaysToExpiration}}
15+
16+
For any questions or support, please visit https://community.letsencrypt.org/.
17+
Unfortunately, we can't provide support by email.
18+
19+
If you want to stop receiving all email from this address, click
20+
|UNSUB:https://mandrillapp.com/unsub|.
21+
22+
Regards,
23+
The Let's Encrypt Team

0 commit comments

Comments
 (0)