app/email/email_test.go

68 lines
1.3 KiB
Go
Raw Normal View History

2021-12-17 05:13:31 +00:00
package email
import (
"testing"
)
2021-12-17 06:18:31 +00:00
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)
}
}
2021-12-17 05:13:31 +00:00
func TestSend(t *testing.T) {
2021-12-17 06:18:31 +00:00
setupDefault()
2021-12-17 05:13:31 +00:00
err := Send("test@kumoly.io",
2021-12-17 06:18:31 +00:00
[]string{"test@kumoly.io"}, "TestSend",
2021-12-17 05:13:31 +00:00
&Body{
2021-12-17 06:18:31 +00:00
Greeting: "歡迎",
Intros: []string{"testing 1.", "loramipsum...."},
Outros: []string{"testing 2,", "blah blah blah..."},
2021-12-17 05:13:31 +00:00
Content: `
# Testing
a|b|c
-|-|-
test||
-|is|
-|-|up`,
},
)
if err != nil {
t.Error(err)
}
}
2021-12-17 06:18:31 +00:00
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)
}
}