68 lines
1.3 KiB
Go
68 lines
1.3 KiB
Go
package email
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestSendSimple(t *testing.T) {
|
|
setupDefault()
|
|
err := Send("test@kumoly.io",
|
|
[]string{"test@kumoly.io"}, "TestSendSimple",
|
|
&Body{
|
|
Content: `Testing`,
|
|
},
|
|
)
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
}
|
|
|
|
func TestSend(t *testing.T) {
|
|
setupDefault()
|
|
err := Send("test@kumoly.io",
|
|
[]string{"test@kumoly.io"}, "TestSend",
|
|
&Body{
|
|
Greeting: "歡迎",
|
|
Intros: []string{"testing 1.", "loramipsum...."},
|
|
Outros: []string{"testing 2,", "blah blah blah..."},
|
|
Content: `
|
|
# Testing
|
|
|
|
a|b|c
|
|
-|-|-
|
|
test||
|
|
-|is|
|
|
-|-|up`,
|
|
},
|
|
)
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
}
|
|
func TestMaintain(t *testing.T) {
|
|
setupDefault()
|
|
err := Send("test@kumoly.io",
|
|
[]string{"test@kumoly.io"}, "TestMaintain",
|
|
&Body{
|
|
Greeting: "您好",
|
|
Receiver: "管理員",
|
|
Sender: "App System",
|
|
Content: `
|
|
> _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/)
|
|
`,
|
|
},
|
|
)
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
}
|