MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / ReceiverName

Method ReceiverName

pkg/email/template.go:203–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

201func (d *templateData) ConsoleURL() string { return d.networkConfig.ConsoleURL }
202func (d *templateData) Receiver() *ttnpb.User { return d.receiver }
203func (d *templateData) ReceiverName() string {
204 if name := d.Receiver().GetName(); name != "" {
205 return name
206 }
207 if id := d.Receiver().GetIds().GetUserId(); id != "" {
208 return id
209 }
210 return "user"
211}
212
213// Execute the message template, rendering it into a Message.
214func (m Template) Execute(data TemplateData) (*Message, error) {

Callers

nothing calls this directly

Calls 4

ReceiverMethod · 0.95
GetUserIdMethod · 0.80
GetNameMethod · 0.45
GetIdsMethod · 0.45

Tested by

no test coverage detected