60 lines
1.7 KiB
Go
60 lines
1.7 KiB
Go
package mailx_test
|
|
|
|
import (
|
|
"testing"
|
|
"wallet-pay-api/pkg/mailx"
|
|
)
|
|
|
|
func TestParseHtmlResource(t *testing.T) {
|
|
html := `<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Document</title>
|
|
<link rel="stylesheet" href="./assets/css/index.css" />
|
|
</head>
|
|
<body>
|
|
<header class="header flex-center">
|
|
<img src="./assets/img/ab-pay-logo.png" alt="" class="logo" />
|
|
</header>
|
|
|
|
<main class="code-main">
|
|
<div class="exception-title">您的收款方式审核失败</div>
|
|
|
|
<div class="exception-content">
|
|
尊敬的ABpay用户,您好!
|
|
您的收款方式审核失败,失败原因人脸识别失败,请检查您的面部是否被遮挡或处于模糊状态,并再次尝试。
|
|
如非本人操作,请立即修改密码或联系客服。
|
|
</div>
|
|
|
|
<div class="exception-ignore">这是一条自动发送的消息,请勿回复</div>
|
|
|
|
<li class="exception-team-tips">ABpay开发者团队服务</li>
|
|
|
|
<section class="contact-us">
|
|
<div class="contact-us-info">
|
|
本邮件由系统自动发出请勿回复,如需要了解更多服务,欢迎访问ABpay官方网
|
|
还可以通以下方式联系我们
|
|
</div>
|
|
|
|
<img src="./assets/img/contact-us-qrcode.png" alt="" class="qr-code" />
|
|
<div class="contact-tel">
|
|
客服电话:<span class="contact-tel-number">400-278-2890</span>
|
|
</div>
|
|
<div class="contact-created-version">2024 ABpay.com.cn . All rightes reserved</div>
|
|
</section>
|
|
</main>
|
|
</body>
|
|
</html>
|
|
`
|
|
|
|
res, err := mailx.ParseHtmlResource(html)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
t.Log(res)
|
|
|
|
}
|