@@ -85,8 +85,8 @@ type RawEndpoint struct {
85
85
Name string `koanf:"name"`
86
86
Kind string `koanf:"kind"`
87
87
TextDisable bool `koanf:"text_disable"`
88
- TitleTemplate string `koanf:"title_template"`
89
- BodyTemplate string `koanf:"body_template"`
88
+ TitleTemplate * string `koanf:"title_template"`
89
+ BodyTemplate * string `koanf:"body_template"`
90
90
AttachmentDisable bool `koanf:"attachment_disable"`
91
91
Config map [string ]string `koanf:"config"`
92
92
}
@@ -237,12 +237,20 @@ func (p Parser) Parse(raw Raw) (Config, error) {
237
237
var endpoints []models.Endpoint
238
238
{
239
239
for key , value := range raw .Endpoints {
240
+ titleTemplate := endpoint .DefaultTitleTemplate
241
+ if value .TitleTemplate != nil {
242
+ titleTemplate = * value .TitleTemplate
243
+ }
244
+ bodyTemplate := endpoint .DefaultBodyTemplate
245
+ if value .BodyTemplate != nil {
246
+ bodyTemplate = * value .BodyTemplate
247
+ }
240
248
e , err := endpoint .NewInternal (endpointFactory , endpoint.CreateEndpoint {
241
249
Name : value .Name ,
242
250
AttachmentDisable : value .AttachmentDisable ,
243
251
TextDisable : value .TextDisable ,
244
- TitleTemplate : value . TitleTemplate ,
245
- BodyTemplate : value . BodyTemplate ,
252
+ TitleTemplate : titleTemplate ,
253
+ BodyTemplate : bodyTemplate ,
246
254
Kind : value .Kind ,
247
255
Config : value .Config ,
248
256
}, key )
0 commit comments