Possibility to customise 'Action Trouble Text'
This commit is contained in:
parent
8fb17c006b
commit
44be377841
|
@ -346,7 +346,7 @@ func (dt *Default) HTMLTemplate() string {
|
||||||
{{ range $action := . }}
|
{{ range $action := . }}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p class="sub">If you’re having trouble with the button '{{ $action.Button.Text }}', copy and paste the URL below into your web browser.</p>
|
<p class="sub">{{printf $.Hermes.Product.TroubleText $action.Button.Text}}</p>
|
||||||
<p class="sub"><a href="{{ $action.Button.Link }}">{{ $action.Button.Link }}</a></p>
|
<p class="sub"><a href="{{ $action.Button.Link }}">{{ $action.Button.Link }}</a></p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -37,6 +37,7 @@ type Product struct {
|
||||||
Link string // e.g. https://matcornic.github.io
|
Link string // e.g. https://matcornic.github.io
|
||||||
Logo string // e.g. https://matcornic.github.io/img/logo.png
|
Logo string // e.g. https://matcornic.github.io/img/logo.png
|
||||||
Copyright string // Copyright © 2017 Hermes. All rights reserved.
|
Copyright string // Copyright © 2017 Hermes. All rights reserved.
|
||||||
|
TroubleText string // TroubleText is the sentence at the end of the email for users having trouble with the button (default to `If you’re having trouble with the button %s, copy and paste the URL below into your web browser.`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Email is the email containing a body
|
// Email is the email containing a body
|
||||||
|
@ -122,6 +123,7 @@ func setDefaultHermesValues(h *Hermes) error {
|
||||||
Product: Product{
|
Product: Product{
|
||||||
Name: "Hermes",
|
Name: "Hermes",
|
||||||
Copyright: "Copyright © 2017 Hermes. All rights reserved.",
|
Copyright: "Copyright © 2017 Hermes. All rights reserved.",
|
||||||
|
TroubleText: "If you’re having trouble with the button '%s', copy and paste the URL below into your web browser.",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
// Merge the given hermes engine configuration with default one
|
// Merge the given hermes engine configuration with default one
|
||||||
|
|
|
@ -102,7 +102,7 @@ func (ed *SimpleExample) assertHTMLContent(t *testing.T, r string) {
|
||||||
assert.Contains(t, r, "http://hermes-link.com", "Product: Should find the link of the product in email")
|
assert.Contains(t, r, "http://hermes-link.com", "Product: Should find the link of the product in email")
|
||||||
assert.Contains(t, r, "Copyright © Hermes-Test", "Product: Should find the Copyright of the product in email")
|
assert.Contains(t, r, "Copyright © Hermes-Test", "Product: Should find the Copyright of the product in email")
|
||||||
assert.Contains(t, r, "http://www.duchess-france.org/wp-content/uploads/2016/01/gopher.png", "Product: Should find the logo of the product in email")
|
assert.Contains(t, r, "http://www.duchess-france.org/wp-content/uploads/2016/01/gopher.png", "Product: Should find the logo of the product in email")
|
||||||
|
assert.Contains(t, r, "If you’re having trouble with the button 'Confirm your account', copy and paste the URL below into your web browser.", "Product: Should find the trouble text in email")
|
||||||
// Assert on email body
|
// Assert on email body
|
||||||
assert.Contains(t, r, "Hi Jon Snow", "Name: Should find the name of the person")
|
assert.Contains(t, r, "Hi Jon Snow", "Name: Should find the name of the person")
|
||||||
assert.Contains(t, r, "Welcome to Hermes", "Intro: Should have intro")
|
assert.Contains(t, r, "Welcome to Hermes", "Intro: Should have intro")
|
||||||
|
|
Loading…
Reference in New Issue