mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-26 21:05:30 +00:00
add sender to template data for relevant modules
This commit is contained in:
@@ -50,6 +50,7 @@ func GetAnyAs[T any](p any) (T, bool) {
|
||||
type TemplateData struct {
|
||||
Payload any
|
||||
Modules any
|
||||
Sender any
|
||||
}
|
||||
|
||||
func GetTemplateData(ctx context.Context, payload any) TemplateData {
|
||||
@@ -58,5 +59,10 @@ func GetTemplateData(ctx context.Context, payload any) TemplateData {
|
||||
if modules != nil {
|
||||
templateData.Modules = modules
|
||||
}
|
||||
|
||||
sender := ctx.Value(common.SenderContextKey)
|
||||
if sender != nil {
|
||||
templateData.Sender = sender
|
||||
}
|
||||
return templateData
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user