Smail/server/hooks/telegram_push/telegram_push_test.go
J3n5en f2a642bf79 ✨ feat: Add Telegram push hook functionality and configuration options
- Add "tgChatId" and "tgBotToken" fields to configuration files
- Modify "config.go" to include new configuration fields
- Implement Telegram push hook functionality in "telegram_push.go"
- Add test file "telegram_push_test.go" to test Telegram push hook functionality
2023-08-28 14:38:09 +08:00

22 lines
373 B
Go

package telegram_push
import (
"pmail/config"
"pmail/dto/parsemail"
"testing"
)
func testInit() {
config.Init()
}
func TestWeChatPushHook_ReceiveParseAfter(t *testing.T) {
testInit()
w := NewTelegramPushHook()
w.ReceiveParseAfter(&parsemail.Email{Subject: "标题", Text: []byte("文本内容"), From: &parsemail.User{
EmailAddress: "hello@gmail.com",
}})
}