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`,
|
2021-12-24 05:31:33 +00:00
|
|
|
Actions: []Action{
|
|
|
|
{Instructions: "click",
|
|
|
|
Button: Button{
|
|
|
|
Text: "click me", Link: "kumoly.io",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{Instructions: "long button",
|
|
|
|
Button: Button{
|
|
|
|
Text: `long long
|
|
|
|
longlonglonglonglonglonglonglonglonglong
|
|
|
|
longlonglonglonglonglonglonglonglonglong
|
|
|
|
longlonglonglonglonglonglonglonglonglong
|
|
|
|
text`,
|
|
|
|
Link: "kumoly.io",
|
|
|
|
Color: "#90CAF9",
|
|
|
|
TextColor: "#000000",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{Instructions: "None",
|
|
|
|
Button: Button{},
|
|
|
|
},
|
|
|
|
{Instructions: "click",
|
|
|
|
InviteCode: "12354",
|
|
|
|
},
|
|
|
|
},
|
2021-12-17 06:18:31 +00:00
|
|
|
},
|
|
|
|
)
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|