22 lines
594 B
Go
22 lines
594 B
Go
package email_template
|
|
|
|
import "fmt"
|
|
|
|
// GetEmailTemplate 取得指定的 Email 樣板
|
|
func GetEmailTemplate(lang Language, typeID TypeID) (string, string, error) {
|
|
// 查找指定語言的模板映射
|
|
templateByLang, exists := EmailTemplateMap[lang]
|
|
if !exists {
|
|
return "", "", fmt.Errorf("email template not found for language: %s", lang)
|
|
}
|
|
|
|
// 查找指定類型的模板生成函數
|
|
templateFunc, exists := templateByLang[typeID]
|
|
if !exists {
|
|
return "", "", fmt.Errorf("email template not found for type ID: %s", typeID)
|
|
}
|
|
|
|
// 執行模板生成函數
|
|
return templateFunc()
|
|
}
|