{{ if .Hermes.Product.Logo }}
-
+
{{ else }}
{{ .Hermes.Product.Name }}
{{ end }}
@@ -237,102 +286,106 @@ func (dt *Default) HTMLTemplate() string {
|
{{if .Email.Body.Title }}{{ .Email.Body.Title }}{{ else }}{{ .Email.Body.Greeting }} {{ .Email.Body.Name }},{{ end }}
{{ with .Email.Body.Intros }}
- {{ if gt (len .) 0 }}
- {{ range $line := . }}
- {{ $line }}
+ {{ if gt (len .) 0 }}
+ {{ range $line := . }}
+ {{ $line }}
+ {{ end }}
+ {{ end }}
+ {{ end }}
+ {{ if (ne .Email.Body.FreeMarkdown "") }}
+ {{ .Email.Body.FreeMarkdown.ToHTML }}
+ {{ else }}
+
+ {{ with .Email.Body.Dictionary }}
+ {{ if gt (len .) 0 }}
+
+ {{ range $entry := . }}
+ - {{ $entry.Key }}:
+ - {{ $entry.Value }}
+ {{ end }}
+
{{ end }}
{{ end }}
- {{ end }}
- {{ with .Email.Body.Dictionary }}
- {{ if gt (len .) 0 }}
-
- {{ range $entry := . }}
- - {{ $entry.Key }}:
- - {{ $entry.Value }}
- {{ end }}
-
- {{ end }}
- {{ end }}
-
-
- {{ with .Email.Body.Table }}
- {{ $data := .Data }}
- {{ $columns := .Columns }}
- {{ if gt (len $data) 0 }}
-
-
-
-
-
- {{ $col := index $data 0 }}
- {{ range $entry := $col }}
-
- {{ $entry.Key }}
- |
- {{ end }}
-
- {{ range $row := $data }}
+
+ {{ with .Email.Body.Table }}
+ {{ $data := .Data }}
+ {{ $columns := .Columns }}
+ {{ if gt (len $data) 0 }}
+
+
+
+
- {{ range $cell := $row }}
-
- {{ $cell.Value }}
- |
+ {{ $entry.Key }}
+
{{ end }}
- {{ end }}
-
- |
-
-
- {{ end }}
- {{ end }}
-
-
- {{ with .Email.Body.Actions }}
- {{ if gt (len .) 0 }}
- {{ range $action := . }}
- {{ $action.Instructions }}
-
-
-
-
+ {{ range $row := $data }}
+ |
+ {{ range $cell := $row }}
+
+ {{ $cell.Value }}
+ |
+ {{ end }}
+
+ {{ end }}
+
{{ end }}
{{ end }}
- {{ end }}
- {{ with .Email.Body.Outros }}
- {{ if gt (len .) 0 }}
- {{ range $line := . }}
- {{ $line }}
+
+ {{ with .Email.Body.Actions }}
+ {{ if gt (len .) 0 }}
+ {{ range $action := . }}
+ {{ $action.Instructions }}
+
+ {{ end }}
{{ end }}
{{ end }}
+
{{ end }}
+ {{ with .Email.Body.Outros }}
+ {{ if gt (len .) 0 }}
+ {{ range $line := . }}
+ {{ $line }}
+ {{ end }}
+ {{ end }}
+ {{ end }}
{{.Email.Body.Signature}},
@@ -340,19 +393,21 @@ func (dt *Default) HTMLTemplate() string {
{{.Hermes.Product.Name}}
- {{ with .Email.Body.Actions }}
-
-
- {{ range $action := . }}
-
-
- {{$.Hermes.Product.TroubleText | replace "{ACTION}" $action.Button.Text}}
- {{ $action.Button.Link }}
- |
-
- {{ end }}
-
-
+ {{ if (eq .Email.Body.FreeMarkdown "") }}
+ {{ with .Email.Body.Actions }}
+
+
+ {{ range $action := . }}
+
+
+ {{$.Hermes.Product.TroubleText | replace "{ACTION}" $action.Button.Text}}
+ {{ $action.Button.Link }}
+ |
+
+ {{ end }}
+
+
+ {{ end }}
{{ end }}
|
@@ -383,19 +438,58 @@ func (dt *Default) HTMLTemplate() string {
// PlainTextTemplate returns a Golang template that will generate an plain text email.
func (dt *Default) PlainTextTemplate() string {
- return `{{if .Email.Body.Title }}{{ .Email.Body.Title }}{{ else }}{{ .Email.Body.Greeting }} {{ .Email.Body.Name }},{{ end }},
-{{ with .Email.Body.Intros }}{{ range $line := . }}{{ $line }}{{ end }}{{ end }}
-{{ with .Email.Body.Dictionary }}{{ range $entry := . }}
-{{ $entry.Key }}: {{ $entry.Value }}{{ end }}{{ end }}
-{{ with .Email.Body.Actions }} {{ range $action := . }}
-{{ $action.Instructions }}
-{{ $action.Button.Link }}{{ end }}{{ end }}
-{{ with .Email.Body.Outros }} {{ range $line := . }}
-{{ $line }}{{ end }}{{ end }}
+ return `{{if .Email.Body.Title }}{{ .Email.Body.Title }}{{ else }}{{ .Email.Body.Greeting }} {{ .Email.Body.Name }}{{ end }},
+{{ with .Email.Body.Intros }}
+ {{ range $line := . }}
+ {{ $line }}
+ {{ end }}
+{{ end }}
+{{ if (ne .Email.Body.FreeMarkdown "") }}
+ {{ .Email.Body.FreeMarkdown.ToHTML }}
+{{ else }}
+ {{ with .Email.Body.Dictionary }}
+
+ {{ range $entry := . }}
+ - {{ $entry.Key }}: {{ $entry.Value }}
+ {{ end }}
+
+ {{ end }}
+ {{ with .Email.Body.Table }}
+ {{ $data := .Data }}
+ {{ $columns := .Columns }}
+ {{ if gt (len $data) 0 }}
+
+
+ {{ $col := index $data 0 }}
+ {{ range $entry := $col }}
+ {{ $entry.Key }} |
+ {{ end }}
+
+ {{ range $row := $data }}
+
+ {{ range $cell := $row }}
+
+ {{ $cell.Value }}
+ |
+ {{ end }}
+
+ {{ end }}
+
+ {{ end }}
+ {{ end }}
+ {{ with .Email.Body.Actions }}
+ {{ range $action := . }}
+ {{ $action.Instructions }} {{ $action.Button.Link }}
+ {{ end }}
+ {{ end }}
+{{ end }}
+{{ with .Email.Body.Outros }}
+ {{ range $line := . }}
+ {{ $line }}
+ {{ end }}
+{{ end }}
+ {{.Email.Body.Signature}}, {{.Hermes.Product.Name}} - {{.Hermes.Product.Link}}
-{{.Email.Body.Signature}},
-{{.Hermes.Product.Name}} - {{.Hermes.Product.Link}}
-
-{{.Hermes.Product.Copyright}}
+{{.Hermes.Product.Copyright}}
`
}
diff --git a/examples/default/default.maintenance.html b/examples/default/default.maintenance.html
new file mode 100644
index 0000000..467dd97
--- /dev/null
+++ b/examples/default/default.maintenance.html
@@ -0,0 +1,345 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+ Hi Jon Snow,
+
+
+
+Hermes service will shutdown the 1st August 2017 for maintenance operations.
+
+
+Services will be unavailable based on the following schedule:
+
+
+
+
+Services |
+Downtime |
+
+
+
+
+
+Service A |
+2AM to 3AM |
+
+
+
+Service B |
+4AM to 5AM |
+
+
+
+Service C |
+5AM to 6AM |
+
+
+
+
+
+
+Feel free to contact us for any question regarding this matter at support@hermes-example.com or in our Gitter
+
+
+
+
+
+ Yours truly,
+
+ Hermes
+
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+
+
+ |
+
+
+
+
diff --git a/examples/default/default.maintenance.txt b/examples/default/default.maintenance.txt
new file mode 100644
index 0000000..2b290fe
--- /dev/null
+++ b/examples/default/default.maintenance.txt
@@ -0,0 +1,28 @@
+------------
+Hi Jon Snow,
+------------
+
+>
+>
+>
+> Hermes service will shutdown the *1st August 2017* for maintenance
+> operations.
+>
+>
+
+Services will be unavailable based on the following schedule:
+
++-----------+------------+
+| SERVICES | DOWNTIME |
++-----------+------------+
+| Service A | 2AM to 3AM |
+| Service B | 4AM to 5AM |
+| Service C | 5AM to 6AM |
++-----------+------------+
+
+Feel free to contact us for any question regarding this matter at support@hermes-example.com ( support@hermes-example.com ) or in our Gitter ( https://gitter.im/ )
+
+Yours truly,
+Hermes - https://example-hermes.com/
+
+Copyright © 2017 Hermes. All rights reserved.
\ No newline at end of file
diff --git a/examples/default/default.receipt.html b/examples/default/default.receipt.html
index 2d821ff..eca17f9 100644
--- a/examples/default/default.receipt.html
+++ b/examples/default/default.receipt.html
@@ -105,6 +105,10 @@
margin-top: 25px;
padding-top: 25px;
border-top: 1px solid #EDEFF2;
+ table-layout: fixed;
+ }
+ .body-sub a {
+ word-break: break-all;
}
.content-cell {
padding: 35px;
@@ -131,6 +135,28 @@
font-size: 14px;
font-weight: bold;
}
+ blockquote {
+ margin: 1.7rem 0;
+ padding-left: 0.85rem;
+ border-left: 10px solid #F0F2F4;
+ }
+ blockquote p {
+ font-size: 1.1rem;
+ color: #999;
+ }
+ blockquote cite {
+ display: block;
+ text-align: right;
+ color: #666;
+ font-size: 1.2rem;
+ }
+ cite {
+ display: block;
+ font-size: 0.925rem;
+ }
+ cite:before {
+ content: "\2014 \0020";
+ }
p {
margin-top: 0;
color: #74787E;
@@ -143,6 +169,29 @@
p.center {
text-align: center;
}
+ table {
+ width: 100%;
+ }
+ th {
+ padding: 0px 5px;
+ padding-bottom: 8px;
+ border-bottom: 1px solid #EDEFF2;
+ }
+ th p {
+ margin: 0;
+ color: #9BA2AB;
+ font-size: 12px;
+ }
+ td {
+ padding: 10px 5px;
+ color: #74787E;
+ font-size: 15px;
+ line-height: 18px;
+ }
+ .content {
+ align: center;
+ padding: 0;
+ }
.data-wrapper {
width: 100%;
@@ -201,7 +250,7 @@
-
+ |
@@ -213,6 +262,7 @@
+
@@ -221,181 +271,188 @@
|
Hi Jon Snow,
-
-
-
- Your order has been processed successfully.
-
-
-
+
+
+
+ Your order has been processed successfully.
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
- Item
- |
-
-
- Description
- |
-
-
- Price
- |
-
+
+
+
+
+
+
+ Item
+ |
+
+
+ Description
+ |
+
+
+ Price
+ |
+
+
+
+
+
+
+ Golang
+ |
+
+
+ Open source programming language that makes it easy to build simple, reliable, and efficient software
+ |
+
+
+ $10.99
+ |
+
+
+
+
+
+
+ Hermes
+ |
+
+
+ Programmatically create beautiful e-mails using Golang.
+ |
+
+
+ $1.99
+ |
+
+
+
+
+ |
-
-
-
-
- Golang
- |
-
-
- Open source programming language that makes it easy to build simple, reliable, and efficient software
- |
-
-
- $10.99
- |
-
-
-
-
-
-
- Hermes
- |
-
-
- Programmatically create beautiful e-mails using Golang.
- |
-
-
- $1.99
- |
-
-
-
-
-
-
-
-
+
+
-
-
-
-
- You can check the status of your order and more in your dashboard:
-
-
-
-
+
+
+
+
+ You can check the status of your order and more in your dashboard:
+
+
+
+
-
+
+
Yours truly,
-
+
Hermes
-
-
-
-
-
- If you’re having trouble with the button 'Go to Dashboard', copy and paste the URL below into your web browser.
- https://hermes-example.com/dashboard
- |
-
-
-
-
-
+
+
+
+
+
+
+
+ If you’re having trouble with the button 'Go to Dashboard', copy and paste the URL below into your web browser.
+ https://hermes-example.com/dashboard
+ |
+
+
+
+
+
+
|
diff --git a/examples/default/default.receipt.txt b/examples/default/default.receipt.txt
index 48a6223..7deb5ef 100644
--- a/examples/default/default.receipt.txt
+++ b/examples/default/default.receipt.txt
@@ -1,12 +1,24 @@
+------------
Hi Jon Snow,
+------------
+
Your order has been processed successfully.
-
-You can check the status of your order and more in your dashboard:
-https://hermes-example.com/dashboard
++--------+--------------------------------+--------+
+| ITEM | DESCRIPTION | PRICE |
++--------+--------------------------------+--------+
+| Golang | Open source programming | $10.99 |
+| | language that makes it easy | |
+| | to build simple, reliable, and | |
+| | efficient software | |
+| Hermes | Programmatically create | $1.99 |
+| | beautiful e-mails using | |
+| | Golang. | |
++--------+--------------------------------+--------+
+You can check the status of your order and more in your dashboard: https://hermes-example.com/dashboard
Yours truly,
-Hermes
+Hermes - https://example-hermes.com/
-Copyright © 2017 Hermes. All rights reserved.
+Copyright © 2017 Hermes. All rights reserved.
\ No newline at end of file
diff --git a/examples/default/default.reset.html b/examples/default/default.reset.html
index 26b7f74..c4004c0 100644
--- a/examples/default/default.reset.html
+++ b/examples/default/default.reset.html
@@ -105,6 +105,10 @@
margin-top: 25px;
padding-top: 25px;
border-top: 1px solid #EDEFF2;
+ table-layout: fixed;
+ }
+ .body-sub a {
+ word-break: break-all;
}
.content-cell {
padding: 35px;
@@ -131,6 +135,28 @@
font-size: 14px;
font-weight: bold;
}
+ blockquote {
+ margin: 1.7rem 0;
+ padding-left: 0.85rem;
+ border-left: 10px solid #F0F2F4;
+ }
+ blockquote p {
+ font-size: 1.1rem;
+ color: #999;
+ }
+ blockquote cite {
+ display: block;
+ text-align: right;
+ color: #666;
+ font-size: 1.2rem;
+ }
+ cite {
+ display: block;
+ font-size: 0.925rem;
+ }
+ cite:before {
+ content: "\2014 \0020";
+ }
p {
margin-top: 0;
color: #74787E;
@@ -143,6 +169,29 @@
p.center {
text-align: center;
}
+ table {
+ width: 100%;
+ }
+ th {
+ padding: 0px 5px;
+ padding-bottom: 8px;
+ border-bottom: 1px solid #EDEFF2;
+ }
+ th p {
+ margin: 0;
+ color: #9BA2AB;
+ font-size: 12px;
+ }
+ td {
+ padding: 10px 5px;
+ color: #74787E;
+ font-size: 15px;
+ line-height: 18px;
+ }
+ .content {
+ align: center;
+ padding: 0;
+ }
.data-wrapper {
width: 100%;
@@ -201,7 +250,7 @@
-
+ |
@@ -213,6 +262,7 @@
+
@@ -221,68 +271,75 @@
|
Hi Jon Snow,
-
-
-
- You have received this email because a password reset request for Hermes account was received.
-
-
-
+
+
+
+ You have received this email because a password reset request for Hermes account was received.
+
+
+
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
- Click the button below to reset your password:
-
-
-
-
+
+
+
+
+ Click the button below to reset your password:
+
+
+
+
-
-
-
- If you did not request a password reset, no further action is required on your part.
-
-
-
+
+
+
+
+ If you did not request a password reset, no further action is required on your part.
+
+
+
Thanks,
-
+
Hermes
-
-
-
-
-
- If you’re having trouble with the button 'Reset your password', copy and paste the URL below into your web browser.
- https://hermes-example.com/reset-password?token=d9729feb74992cc3482b350163a1a010
- |
-
-
-
-
-
+
+
+
+
+
+
+
+ If you’re having trouble with the button 'Reset your password', copy and paste the URL below into your web browser.
+ https://hermes-example.com/reset-password?token=d9729feb74992cc3482b350163a1a010
+ |
+
+
+
+
+
+
|
diff --git a/examples/default/default.reset.txt b/examples/default/default.reset.txt
index f5d1d70..bfbba50 100644
--- a/examples/default/default.reset.txt
+++ b/examples/default/default.reset.txt
@@ -1,13 +1,14 @@
+------------
Hi Jon Snow,
+------------
+
You have received this email because a password reset request for Hermes account was received.
-
-Click the button below to reset your password:
-https://hermes-example.com/reset-password?token=d9729feb74992cc3482b350163a1a010
-
+Click the button below to reset your password: https://hermes-example.com/reset-password?token=d9729feb74992cc3482b350163a1a010
+
If you did not request a password reset, no further action is required on your part.
Thanks,
-Hermes
+Hermes - https://example-hermes.com/
-Copyright © 2017 Hermes. All rights reserved.
+Copyright © 2017 Hermes. All rights reserved.
\ No newline at end of file
diff --git a/examples/default/default.welcome.html b/examples/default/default.welcome.html
index 7bbbadc..8bbe624 100644
--- a/examples/default/default.welcome.html
+++ b/examples/default/default.welcome.html
@@ -105,6 +105,10 @@
margin-top: 25px;
padding-top: 25px;
border-top: 1px solid #EDEFF2;
+ table-layout: fixed;
+ }
+ .body-sub a {
+ word-break: break-all;
}
.content-cell {
padding: 35px;
@@ -131,6 +135,28 @@
font-size: 14px;
font-weight: bold;
}
+ blockquote {
+ margin: 1.7rem 0;
+ padding-left: 0.85rem;
+ border-left: 10px solid #F0F2F4;
+ }
+ blockquote p {
+ font-size: 1.1rem;
+ color: #999;
+ }
+ blockquote cite {
+ display: block;
+ text-align: right;
+ color: #666;
+ font-size: 1.2rem;
+ }
+ cite {
+ display: block;
+ font-size: 0.925rem;
+ }
+ cite:before {
+ content: "\2014 \0020";
+ }
p {
margin-top: 0;
color: #74787E;
@@ -143,6 +169,29 @@
p.center {
text-align: center;
}
+ table {
+ width: 100%;
+ }
+ th {
+ padding: 0px 5px;
+ padding-bottom: 8px;
+ border-bottom: 1px solid #EDEFF2;
+ }
+ th p {
+ margin: 0;
+ color: #9BA2AB;
+ font-size: 12px;
+ }
+ td {
+ padding: 10px 5px;
+ color: #74787E;
+ font-size: 15px;
+ line-height: 18px;
+ }
+ .content {
+ align: center;
+ padding: 0;
+ }
.data-wrapper {
width: 100%;
@@ -201,7 +250,7 @@
-
+ |
@@ -213,6 +262,7 @@
+
@@ -221,83 +271,90 @@
|
Hi Jon Snow,
-
-
-
- Welcome to Hermes! We're very excited to have you on board.
-
-
-
+
+
+
+ Welcome to Hermes! We're very excited to have you on board.
+
+
+
+
-
-
-
-
- - Firstname:
- - Jon
-
- - Lastname:
- - Snow
-
- - Birthday:
- - 01/01/283
-
-
-
-
+
+
+
+
+ - Firstname:
+ - Jon
+
+ - Lastname:
+ - Snow
+
+ - Birthday:
+ - 01/01/283
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
- To get started with Hermes, please click here:
-
-
-
-
+
+
+
+
+ To get started with Hermes, please click here:
+
+
+
+
-
-
-
- Need help, or have questions? Just reply to this email, we'd love to help.
-
-
-
+
+
+
+
+ Need help, or have questions? Just reply to this email, we'd love to help.
+
+
+
Yours truly,
-
+
Hermes
-
-
-
-
-
- If you’re having trouble with the button 'Confirm your account', copy and paste the URL below into your web browser.
- https://hermes-example.com/confirm?token=d9729feb74992cc3482b350163a1a010
- |
-
-
-
-
-
+
+
+
+
+
+
+
+ If you’re having trouble with the button 'Confirm your account', copy and paste the URL below into your web browser.
+ https://hermes-example.com/confirm?token=d9729feb74992cc3482b350163a1a010
+ |
+
+
+
+
+
+
|
diff --git a/examples/default/default.welcome.txt b/examples/default/default.welcome.txt
index bb711e1..4982150 100644
--- a/examples/default/default.welcome.txt
+++ b/examples/default/default.welcome.txt
@@ -1,16 +1,18 @@
+------------
Hi Jon Snow,
-Welcome to Hermes! We're very excited to have you on board.
+------------
-Firstname: Jon
-Lastname: Snow
-Birthday: 01/01/283
-
-To get started with Hermes, please click here:
-https://hermes-example.com/confirm?token=d9729feb74992cc3482b350163a1a010
-
-Need help, or have questions? Just reply to this email, we'd love to help.
+Welcome to Hermes! We're very excited to have you on board.
+
+* Firstname: Jon
+* Lastname: Snow
+* Birthday: 01/01/283
+
+To get started with Hermes, please click here: https://hermes-example.com/confirm?token=d9729feb74992cc3482b350163a1a010
+
+Need help, or have questions? Just reply to this email, we'd love to help.
Yours truly,
-Hermes
+Hermes - https://example-hermes.com/
-Copyright © 2017 Hermes. All rights reserved.
+Copyright © 2017 Hermes. All rights reserved.
\ No newline at end of file
diff --git a/examples/flat/flat.maintenance.html b/examples/flat/flat.maintenance.html
new file mode 100644
index 0000000..9cc1e75
--- /dev/null
+++ b/examples/flat/flat.maintenance.html
@@ -0,0 +1,345 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+ Hi Jon Snow,
+
+
+
+Hermes service will shutdown the 1st August 2017 for maintenance operations.
+
+
+Services will be unavailable based on the following schedule:
+
+
+
+
+Services |
+Downtime |
+
+
+
+
+
+Service A |
+2AM to 3AM |
+
+
+
+Service B |
+4AM to 5AM |
+
+
+
+Service C |
+5AM to 6AM |
+
+
+
+
+
+
+Feel free to contact us for any question regarding this matter at support@hermes-example.com or in our Gitter
+
+
+
+
+
+ Yours truly,
+
+ Hermes
+
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+
+
+ |
+
+
+
+
diff --git a/examples/flat/flat.maintenance.txt b/examples/flat/flat.maintenance.txt
new file mode 100644
index 0000000..2b290fe
--- /dev/null
+++ b/examples/flat/flat.maintenance.txt
@@ -0,0 +1,28 @@
+------------
+Hi Jon Snow,
+------------
+
+>
+>
+>
+> Hermes service will shutdown the *1st August 2017* for maintenance
+> operations.
+>
+>
+
+Services will be unavailable based on the following schedule:
+
++-----------+------------+
+| SERVICES | DOWNTIME |
++-----------+------------+
+| Service A | 2AM to 3AM |
+| Service B | 4AM to 5AM |
+| Service C | 5AM to 6AM |
++-----------+------------+
+
+Feel free to contact us for any question regarding this matter at support@hermes-example.com ( support@hermes-example.com ) or in our Gitter ( https://gitter.im/ )
+
+Yours truly,
+Hermes - https://example-hermes.com/
+
+Copyright © 2017 Hermes. All rights reserved.
\ No newline at end of file
diff --git a/examples/flat/flat.receipt.html b/examples/flat/flat.receipt.html
new file mode 100644
index 0000000..a972612
--- /dev/null
+++ b/examples/flat/flat.receipt.html
@@ -0,0 +1,479 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+ Hi Jon Snow,
+
+
+
+ Your order has been processed successfully.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Item
+ |
+
+
+ Description
+ |
+
+
+ Price
+ |
+
+
+
+
+
+
+ Golang
+ |
+
+
+ Open source programming language that makes it easy to build simple, reliable, and efficient software
+ |
+
+
+ $10.99
+ |
+
+
+
+
+
+
+ Hermes
+ |
+
+
+ Programmatically create beautiful e-mails using Golang.
+ |
+
+
+ $1.99
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+ You can check the status of your order and more in your dashboard:
+
+
+
+
+
+
+
+
+
+ Yours truly,
+
+ Hermes
+
+
+
+
+
+
+
+
+
+ If you’re having trouble with the button 'Go to Dashboard', copy and paste the URL below into your web browser.
+ https://hermes-example.com/dashboard
+ |
+
+
+
+
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+
+
+ |
+
+
+
+
diff --git a/examples/flat/flat.receipt.txt b/examples/flat/flat.receipt.txt
new file mode 100644
index 0000000..7deb5ef
--- /dev/null
+++ b/examples/flat/flat.receipt.txt
@@ -0,0 +1,24 @@
+------------
+Hi Jon Snow,
+------------
+
+Your order has been processed successfully.
+
++--------+--------------------------------+--------+
+| ITEM | DESCRIPTION | PRICE |
++--------+--------------------------------+--------+
+| Golang | Open source programming | $10.99 |
+| | language that makes it easy | |
+| | to build simple, reliable, and | |
+| | efficient software | |
+| Hermes | Programmatically create | $1.99 |
+| | beautiful e-mails using | |
+| | Golang. | |
++--------+--------------------------------+--------+
+
+You can check the status of your order and more in your dashboard: https://hermes-example.com/dashboard
+
+Yours truly,
+Hermes - https://example-hermes.com/
+
+Copyright © 2017 Hermes. All rights reserved.
\ No newline at end of file
diff --git a/examples/flat/flat.reset.html b/examples/flat/flat.reset.html
new file mode 100644
index 0000000..1b02b76
--- /dev/null
+++ b/examples/flat/flat.reset.html
@@ -0,0 +1,366 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+ Hi Jon Snow,
+
+
+
+ You have received this email because a password reset request for Hermes account was received.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Click the button below to reset your password:
+
+
+
+
+
+
+
+
+
+ If you did not request a password reset, no further action is required on your part.
+
+
+
+
+
+ Thanks,
+
+ Hermes
+
+
+
+
+
+
+
+
+
+ If you’re having trouble with the button 'Reset your password', copy and paste the URL below into your web browser.
+ https://hermes-example.com/reset-password?token=d9729feb74992cc3482b350163a1a010
+ |
+
+
+
+
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+
+
+ |
+
+
+
+
diff --git a/examples/flat/flat.reset.txt b/examples/flat/flat.reset.txt
new file mode 100644
index 0000000..bfbba50
--- /dev/null
+++ b/examples/flat/flat.reset.txt
@@ -0,0 +1,14 @@
+------------
+Hi Jon Snow,
+------------
+
+You have received this email because a password reset request for Hermes account was received.
+
+Click the button below to reset your password: https://hermes-example.com/reset-password?token=d9729feb74992cc3482b350163a1a010
+
+If you did not request a password reset, no further action is required on your part.
+
+Thanks,
+Hermes - https://example-hermes.com/
+
+Copyright © 2017 Hermes. All rights reserved.
\ No newline at end of file
diff --git a/examples/flat/flat.welcome.html b/examples/flat/flat.welcome.html
new file mode 100644
index 0000000..ecf7c53
--- /dev/null
+++ b/examples/flat/flat.welcome.html
@@ -0,0 +1,381 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+ Hi Jon Snow,
+
+
+
+ Welcome to Hermes! We're very excited to have you on board.
+
+
+
+
+
+
+
+
+
+ - Firstname:
+ - Jon
+
+ - Lastname:
+ - Snow
+
+ - Birthday:
+ - 01/01/283
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To get started with Hermes, please click here:
+
+
+
+
+
+
+
+
+
+ Need help, or have questions? Just reply to this email, we'd love to help.
+
+
+
+
+
+ Yours truly,
+
+ Hermes
+
+
+
+
+
+
+
+
+
+ If you’re having trouble with the button 'Confirm your account', copy and paste the URL below into your web browser.
+ https://hermes-example.com/confirm?token=d9729feb74992cc3482b350163a1a010
+ |
+
+
+
+
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+
+
+ |
+
+
+
+
diff --git a/examples/flat/flat.welcome.txt b/examples/flat/flat.welcome.txt
new file mode 100644
index 0000000..4982150
--- /dev/null
+++ b/examples/flat/flat.welcome.txt
@@ -0,0 +1,18 @@
+------------
+Hi Jon Snow,
+------------
+
+Welcome to Hermes! We're very excited to have you on board.
+
+* Firstname: Jon
+* Lastname: Snow
+* Birthday: 01/01/283
+
+To get started with Hermes, please click here: https://hermes-example.com/confirm?token=d9729feb74992cc3482b350163a1a010
+
+Need help, or have questions? Just reply to this email, we'd love to help.
+
+Yours truly,
+Hermes - https://example-hermes.com/
+
+Copyright © 2017 Hermes. All rights reserved.
\ No newline at end of file
diff --git a/examples/images/maintainance.jpg b/examples/images/maintainance.jpg
deleted file mode 100644
index 7a1d9b7..0000000
Binary files a/examples/images/maintainance.jpg and /dev/null differ
diff --git a/examples/default/main.go b/examples/main.go
similarity index 60%
rename from examples/default/main.go
rename to examples/main.go
index b366adb..00fc9ac 100644
--- a/examples/default/main.go
+++ b/examples/main.go
@@ -4,6 +4,7 @@ import (
"fmt"
"github.com/matcornic/hermes"
"io/ioutil"
+ "os"
)
type example interface {
@@ -12,6 +13,7 @@ type example interface {
}
func main() {
+
h := hermes.Hermes{
Product: hermes.Product{
Name: "Hermes",
@@ -24,10 +26,19 @@ func main() {
new(welcome),
new(reset),
new(receipt),
+ new(maintenance),
}
- for _, e := range examples {
- generateEmails(h, e.Email(), e.Name())
+ themes := []hermes.Theme{
+ new(hermes.Default),
+ new(hermes.Flat),
+ }
+
+ for _, theme := range themes {
+ h.Theme = theme
+ for _, e := range examples {
+ generateEmails(h, e.Email(), e.Name())
+ }
}
}
@@ -38,7 +49,11 @@ func generateEmails(h hermes.Hermes, email hermes.Email, example string) {
if err != nil {
panic(err)
}
- err = ioutil.WriteFile(fmt.Sprintf("%v.%v.html", h.Theme.Name(), example), []byte(res), 0644)
+ err = os.MkdirAll(h.Theme.Name(), 0744)
+ if err != nil {
+ panic(err)
+ }
+ err = ioutil.WriteFile(fmt.Sprintf("%v/%v.%v.html", h.Theme.Name(), h.Theme.Name(), example), []byte(res), 0644)
if err != nil {
panic(err)
}
@@ -48,7 +63,7 @@ func generateEmails(h hermes.Hermes, email hermes.Email, example string) {
if err != nil {
panic(err)
}
- err = ioutil.WriteFile(fmt.Sprintf("%v.%v.txt", h.Theme.Name(), example), []byte(res), 0644)
+ err = ioutil.WriteFile(fmt.Sprintf("%v/%v.%v.txt", h.Theme.Name(), h.Theme.Name(), example), []byte(res), 0644)
if err != nil {
panic(err)
}
diff --git a/examples/maintenance.go b/examples/maintenance.go
new file mode 100644
index 0000000..bc8c761
--- /dev/null
+++ b/examples/maintenance.go
@@ -0,0 +1,36 @@
+package main
+
+import (
+ "github.com/matcornic/hermes"
+)
+
+type maintenance struct {
+}
+
+func (w *maintenance) Name() string {
+ return "maintenance"
+}
+
+func (w *maintenance) Email() hermes.Email {
+ return hermes.Email{
+ Body: hermes.Body{
+ Name: "Jon Snow",
+ FreeMarkdown: `
+> _Hermes_ service will shutdown the **1st August 2017** for maintenance operations.
+
+Services will be unavailable based on the following schedule:
+
+| Services | Downtime |
+| :------:| :-----------: |
+| Service A | 2AM to 3AM |
+| Service B | 4AM to 5AM |
+| Service C | 5AM to 6AM |
+
+---
+
+Feel free to contact us for any question regarding this matter at [support@hermes-example.com](mailto:support@hermes-example.com) or in our [Gitter](https://gitter.im/)
+
+`,
+ },
+ }
+}
diff --git a/examples/default/receipt.go b/examples/receipt.go
similarity index 100%
rename from examples/default/receipt.go
rename to examples/receipt.go
diff --git a/examples/default/reset.go b/examples/reset.go
similarity index 100%
rename from examples/default/reset.go
rename to examples/reset.go
diff --git a/examples/default/welcome.go b/examples/welcome.go
similarity index 83%
rename from examples/default/welcome.go
rename to examples/welcome.go
index 476a722..7a692a7 100644
--- a/examples/default/welcome.go
+++ b/examples/welcome.go
@@ -27,9 +27,8 @@ func (w *welcome) Email() hermes.Email {
{
Instructions: "To get started with Hermes, please click here:",
Button: hermes.Button{
- Color: "#22BC66",
- Text: "Confirm your account",
- Link: "https://hermes-example.com/confirm?token=d9729feb74992cc3482b350163a1a010",
+ Text: "Confirm your account",
+ Link: "https://hermes-example.com/confirm?token=d9729feb74992cc3482b350163a1a010",
},
},
},
diff --git a/flat.go b/flat.go
new file mode 100644
index 0000000..26a4f32
--- /dev/null
+++ b/flat.go
@@ -0,0 +1,495 @@
+package hermes
+
+// Flat is a theme
+type Flat struct{}
+
+// Name returns the name of the flat theme
+func (dt *Flat) Name() string {
+ return "flat"
+}
+
+// HTMLTemplate returns a Golang template that will generate an HTML email.
+func (dt *Flat) HTMLTemplate() string {
+ return `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ if .Hermes.Product.Logo }}
+
+ {{ else }}
+ {{ .Hermes.Product.Name }}
+ {{ end }}
+
+ |
+
+
+
+
+
+
+
+
+
+ {{if .Email.Body.Title }}{{ .Email.Body.Title }}{{ else }}{{ .Email.Body.Greeting }} {{ .Email.Body.Name }},{{ end }}
+ {{ with .Email.Body.Intros }}
+ {{ if gt (len .) 0 }}
+ {{ range $line := . }}
+ {{ $line }}
+ {{ end }}
+ {{ end }}
+ {{ end }}
+ {{ if (ne .Email.Body.FreeMarkdown "") }}
+ {{ .Email.Body.FreeMarkdown.ToHTML }}
+ {{ else }}
+
+ {{ with .Email.Body.Dictionary }}
+ {{ if gt (len .) 0 }}
+
+ {{ range $entry := . }}
+ - {{ $entry.Key }}:
+ - {{ $entry.Value }}
+ {{ end }}
+
+ {{ end }}
+ {{ end }}
+
+
+ {{ with .Email.Body.Table }}
+ {{ $data := .Data }}
+ {{ $columns := .Columns }}
+ {{ if gt (len $data) 0 }}
+
+
+
+
+
+ {{ $col := index $data 0 }}
+ {{ range $entry := $col }}
+
+ {{ $entry.Key }}
+ |
+ {{ end }}
+
+ {{ range $row := $data }}
+
+ {{ range $cell := $row }}
+
+ {{ $cell.Value }}
+ |
+ {{ end }}
+
+ {{ end }}
+
+ |
+
+
+ {{ end }}
+ {{ end }}
+
+
+ {{ with .Email.Body.Actions }}
+ {{ if gt (len .) 0 }}
+ {{ range $action := . }}
+ {{ $action.Instructions }}
+
+ {{ end }}
+ {{ end }}
+ {{ end }}
+
+ {{ end }}
+ {{ with .Email.Body.Outros }}
+ {{ if gt (len .) 0 }}
+ {{ range $line := . }}
+ {{ $line }}
+ {{ end }}
+ {{ end }}
+ {{ end }}
+
+
+ {{.Email.Body.Signature}},
+
+ {{.Hermes.Product.Name}}
+
+
+ {{ if (eq .Email.Body.FreeMarkdown "") }}
+ {{ with .Email.Body.Actions }}
+
+
+ {{ range $action := . }}
+
+
+ {{$.Hermes.Product.TroubleText | replace "{ACTION}" $action.Button.Text}}
+ {{ $action.Button.Link }}
+ |
+
+ {{ end }}
+
+
+ {{ end }}
+ {{ end }}
+ |
+
+
+ |
+
+
+
+
+ |
+
+
+ |
+
+
+
+
+`
+}
+
+// PlainTextTemplate returns a Golang template that will generate an plain text email.
+func (dt *Flat) PlainTextTemplate() string {
+ return `{{if .Email.Body.Title }}{{ .Email.Body.Title }}{{ else }}{{ .Email.Body.Greeting }} {{ .Email.Body.Name }}{{ end }},
+{{ with .Email.Body.Intros }}
+ {{ range $line := . }}
+ {{ $line }}
+ {{ end }}
+{{ end }}
+{{ if (ne .Email.Body.FreeMarkdown "") }}
+ {{ .Email.Body.FreeMarkdown.ToHTML }}
+{{ else }}
+ {{ with .Email.Body.Dictionary }}
+
+ {{ range $entry := . }}
+ - {{ $entry.Key }}: {{ $entry.Value }}
+ {{ end }}
+
+ {{ end }}
+ {{ with .Email.Body.Table }}
+ {{ $data := .Data }}
+ {{ $columns := .Columns }}
+ {{ if gt (len $data) 0 }}
+
+
+ {{ $col := index $data 0 }}
+ {{ range $entry := $col }}
+ {{ $entry.Key }} |
+ {{ end }}
+
+ {{ range $row := $data }}
+
+ {{ range $cell := $row }}
+
+ {{ $cell.Value }}
+ |
+ {{ end }}
+
+ {{ end }}
+
+ {{ end }}
+ {{ end }}
+ {{ with .Email.Body.Actions }}
+ {{ range $action := . }}
+ {{ $action.Instructions }} {{ $action.Button.Link }}
+ {{ end }}
+ {{ end }}
+{{ end }}
+{{ with .Email.Body.Outros }}
+ {{ range $line := . }}
+ {{ $line }}
+ {{ end }}
+{{ end }}
+ {{.Email.Body.Signature}}, {{.Hermes.Product.Name}} - {{.Hermes.Product.Link}}
+
+{{.Hermes.Product.Copyright}}
+`
+}
diff --git a/hermes.go b/hermes.go
index d76d5f2..853a555 100644
--- a/hermes.go
+++ b/hermes.go
@@ -4,6 +4,8 @@ import (
"bytes"
"github.com/Masterminds/sprig"
"github.com/imdario/mergo"
+ "github.com/jaytaylor/html2text"
+ "github.com/russross/blackfriday"
"html/template"
)
@@ -21,9 +23,15 @@ type Theme interface {
PlainTextTemplate() string // The golang templte for plain text emails (can be basic HTML)
}
-// TextDirection of the text in HTML email@
+// TextDirection of the text in HTML email
type TextDirection string
+var templateFuncs = template.FuncMap{
+ "url": func(s string) template.URL {
+ return template.URL(s)
+ },
+}
+
// TDLeftToRight is the text direction from left to right (default)
const TDLeftToRight TextDirection = "ltr"
@@ -45,17 +53,27 @@ type Email struct {
Body Body
}
+// Markdown is a HTML template (a string) representing Markdown content
+// https://en.wikipedia.org/wiki/Markdown
+type Markdown template.HTML
+
// Body is the body of the email, containing all interesting data
type Body struct {
- Name string // The name of the contacted person
- Intros []string // Intro sentences, first displayed in the email
- Dictionary []Entry // A list of key+value (useful for displaying parameters/settings/personal info)
- Table Table // Table is an table where you can put data (pricing grid, a bill, and so on)
- Actions []Action // Actions are a list of actions that the user will be able to execute via a button click
- Outros []string // Outro sentences, last displayed in the email
- Greeting string // Greeting for the contacted person (default to 'Hi')
- Signature string // Signature for the contacted person (default to 'Yours truly')
- Title string // Title replaces the greeting+name when set
+ Name string // The name of the contacted person
+ Intros []string // Intro sentences, first displayed in the email
+ Dictionary []Entry // A list of key+value (useful for displaying parameters/settings/personal info)
+ Table Table // Table is an table where you can put data (pricing grid, a bill, and so on)
+ Actions []Action // Actions are a list of actions that the user will be able to execute via a button click
+ Outros []string // Outro sentences, last displayed in the email
+ Greeting string // Greeting for the contacted person (default to 'Hi')
+ Signature string // Signature for the contacted person (default to 'Yours truly')
+ Title string // Title replaces the greeting+name when set
+ FreeMarkdown Markdown // Free markdown content that replaces all content other than header and footer
+}
+
+// ToHTML converts Markdown to HTML
+func (c Markdown) ToHTML() template.HTML {
+ return template.HTML(blackfriday.MarkdownCommon([]byte(string(c))))
}
// Entry is a simple entry of a map
@@ -156,7 +174,11 @@ func (h *Hermes) GeneratePlainText(email Email) (string, error) {
if err != nil {
return "", err
}
- return h.generateTemplate(email, h.Theme.PlainTextTemplate())
+ template, err := h.generateTemplate(email, h.Theme.PlainTextTemplate())
+ if err != nil {
+ return "", err
+ }
+ return html2text.FromString(template, html2text.Options{PrettyTables: true})
}
func (h *Hermes) generateTemplate(email Email, tplt string) (string, error) {
@@ -168,7 +190,7 @@ func (h *Hermes) generateTemplate(email Email, tplt string) (string, error) {
// Generate the email from Golang template
// Allow usage of simple function from sprig : https://github.com/Masterminds/sprig
- t, err := template.New("hermes").Funcs(sprig.FuncMap()).Parse(tplt)
+ t, err := template.New("hermes").Funcs(sprig.FuncMap()).Funcs(templateFuncs).Parse(tplt)
if err != nil {
return "", err
}
diff --git a/hermes_test.go b/hermes_test.go
index 87d3ef9..fccdb64 100644
--- a/hermes_test.go
+++ b/hermes_test.go
@@ -8,6 +8,7 @@ import (
var testedThemes = []Theme{
// Insert your new theme here
new(Default),
+ new(Flat),
}
/////////////////////////////////////////////////////
@@ -130,10 +131,18 @@ func (ed *SimpleExample) assertPlainTextContent(t *testing.T, r string) {
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, "Birthday", "Dictionary: Should have dictionary")
- assert.NotContains(t, r, "Open source programming language", "Table: Not possible to have table in plain text")
- assert.NotContains(t, r, "Programmatically create beautiful e-mails using Golang", "Table: Not possible to have table in plain text")
- assert.NotContains(t, r, "$10.99", "Table: Not possible to have table in plain text")
- assert.NotContains(t, r, "$1.99", "Table: Not possible to have table in plain text")
+ assert.Contains(t, r, "Open source", "Table: Should have table content")
+ assert.Contains(t, r, `+--------+--------------------------------+--------+
+| ITEM | DESCRIPTION | PRICE |
++--------+--------------------------------+--------+
+| Golang | Open source programming | $10.99 |
+| | language that makes it easy | |
+| | to build simple, reliable, and | |
+| | efficient software | |
+| Hermes | Programmatically create | $1.99 |
+| | beautiful e-mails using | |
+| | Golang. | |
++--------+--------------------------------+--------`, "Table: Should have pretty table content")
assert.Contains(t, r, "started with Hermes", "Action: Should have instruction")
assert.NotContains(t, r, "Confirm your account", "Action: Should not have button of action in plain text")
assert.NotContains(t, r, "#22BC66", "Action: Button should not have color in plain text")
@@ -237,6 +246,103 @@ func (ed *WithSignatureDifferentThanDefault) assertPlainTextContent(t *testing.T
assert.Contains(t, r, "Best regards", "Should have greeting with Dear")
}
+type WithFreeMarkdownContent struct {
+ theme Theme
+}
+
+func (ed *WithFreeMarkdownContent) getExample() (Hermes, Email) {
+ h := Hermes{
+ Theme: ed.theme,
+ Product: Product{
+ Name: "Hermes",
+ Link: "http://hermes.com",
+ },
+ }
+
+ email := Email{
+ Body{
+ Name: "Jon Snow",
+ FreeMarkdown: `
+> _Hermes_ service will shutdown the **1st August 2017** for maintenance operations.
+
+Services will be unavailable based on the following schedule:
+
+| Services | Downtime |
+| :------:| :-----------: |
+| Service A | 2AM to 3AM |
+| Service B | 4AM to 5AM |
+| Service C | 5AM to 6AM |
+
+---
+
+Feel free to contact us for any question regarding this matter at [support@hermes-example.com](mailto:support@hermes-example.com) or in our [Gitter](https://gitter.im/)
+
+`,
+ Intros: []string{
+ "An intro that should be kept even with FreeMarkdown",
+ },
+ Dictionary: []Entry{
+ {"Dictionary that should not be displayed", "Because of FreeMarkdown"},
+ },
+ Table: Table{
+ Data: [][]Entry{
+ {
+ {Key: "Item", Value: "Golang"},
+ },
+ {
+ {Key: "Item", Value: "Hermes"},
+ },
+ },
+ },
+ Actions: []Action{
+ {
+ Instructions: "Action that should not be displayed, because of FreeMarkdown:",
+ Button: Button{
+ Color: "#22BC66",
+ Text: "Button",
+ Link: "https://hermes-example.com/confirm?token=d9729feb74992cc3482b350163a1a010",
+ },
+ },
+ },
+ Outros: []string{
+ "An outro that should be kept even with FreeMarkdown",
+ },
+ },
+ }
+ return h, email
+}
+
+func (ed *WithFreeMarkdownContent) assertHTMLContent(t *testing.T, r string) {
+ assert.Contains(t, r, "Yours truly", "Should find signature with 'Yours truly' which is default")
+ assert.Contains(t, r, "Jon Snow", "Should find title with 'Jon Snow'")
+ assert.Contains(t, r, "Hermes service will shutdown", "Should find quote as HTML formatted content")
+ assert.Contains(t, r, " | 2AM to 3AM | ", "Should find cell content as HTML formatted content")
+ assert.Contains(t, r, "support@hermes-example.com", "Should find link of mailto as HTML formatted content")
+ assert.Contains(t, r, "An intro that should be kept even with FreeMarkdown", "Should find intro even with FreeMarkdown")
+ assert.Contains(t, r, "An outro that should be kept even with FreeMarkdown", "Should find outro even with FreeMarkdown")
+ assert.NotContains(t, r, "should not be displayed", "Should find any other content that the one from FreeMarkdown object")
+}
+
+func (ed *WithFreeMarkdownContent) assertPlainTextContent(t *testing.T, r string) {
+ assert.Contains(t, r, "Yours truly", "Should find signature with 'Yours truly' which is default")
+ assert.Contains(t, r, "Jon Snow", "Should find title with 'Jon Snow'")
+ assert.Contains(t, r, "> Hermes service will shutdown", "Should find quote as plain text with quote emphaze on sentence")
+ assert.Contains(t, r, "2AM to 3AM", "Should find cell content as plain text")
+ assert.Contains(t, r, `+-----------+------------+
+| SERVICES | DOWNTIME |
++-----------+------------+
+| Service A | 2AM to 3AM |
+| Service B | 4AM to 5AM |
+| Service C | 5AM to 6AM |
++-----------+------------+`, "Should find pretty table as plain text")
+ assert.Contains(t, r, "support@hermes-example.com", "Should find link of mailto as plain text")
+ assert.NotContains(t, r, "", "Should not find html table tags")
+ assert.NotContains(t, r, "", "Should not find html tr tags")
+ assert.NotContains(t, r, "", "Should not find html link tags")
+ assert.NotContains(t, r, "should not be displayed", "Should find any other content that the one from FreeMarkdown object")
+
+}
+
// Test all the themes for the features
func TestThemeSimple(t *testing.T) {
@@ -263,6 +369,12 @@ func TestThemeWithGreetingDiffrentThanDefault(t *testing.T) {
}
}
+func TestThemeWithFreeMarkdownContent(t *testing.T) {
+ for _, theme := range testedThemes {
+ checkExample(t, &WithFreeMarkdownContent{theme})
+ }
+}
+
func checkExample(t *testing.T, ex Example) {
// Given an example
h, email := ex.getExample()
@@ -346,6 +458,7 @@ func TestHermes_Default(t *testing.T) {
assert.Empty(t, email.Body.Table.Data)
assert.Empty(t, email.Body.Table.Columns.CustomWidth)
assert.Empty(t, email.Body.Table.Columns.CustomAlignement)
+ assert.Empty(t, string(email.Body.FreeMarkdown))
assert.Equal(t, email.Body.Greeting, "Hi")
assert.Equal(t, email.Body.Signature, "Yours truly")
diff --git a/screens/flat/receipt.png b/screens/flat/receipt.png
new file mode 100644
index 0000000..80c494d
Binary files /dev/null and b/screens/flat/receipt.png differ
diff --git a/screens/flat/reset.png b/screens/flat/reset.png
new file mode 100644
index 0000000..d516f32
Binary files /dev/null and b/screens/flat/reset.png differ
diff --git a/screens/flat/welcome.png b/screens/flat/welcome.png
new file mode 100644
index 0000000..4272512
Binary files /dev/null and b/screens/flat/welcome.png differ
diff --git a/screens/free-markdown.png b/screens/free-markdown.png
new file mode 100644
index 0000000..e6652b0
Binary files /dev/null and b/screens/free-markdown.png differ
| | | |