()
| 22 | ) |
| 23 | |
| 24 | func init() { |
| 25 | tmpl, err := email.NewTemplateFS( |
| 26 | fsys, ttnpb.GetNotificationTypeString(ttnpb.NotificationType_USER_REQUESTED), |
| 27 | email.FSTemplate{ |
| 28 | SubjectTemplate: "A new user has requested to join {{ .Network.Name }}", |
| 29 | HTMLTemplateBaseFile: "base.html.tmpl", |
| 30 | HTMLTemplateFile: "user_requested.html.tmpl", |
| 31 | TextTemplateFile: "user_requested.txt.tmpl", |
| 32 | }, |
| 33 | ) |
| 34 | if err != nil { |
| 35 | panic(err) |
| 36 | } |
| 37 | email.RegisterTemplate(tmpl) |
| 38 | email.RegisterNotification( |
| 39 | ttnpb.GetNotificationTypeString(ttnpb.NotificationType_USER_REQUESTED), &email.NotificationBuilder{ |
| 40 | EmailTemplateName: ttnpb.GetNotificationTypeString(ttnpb.NotificationType_USER_REQUESTED), |
| 41 | DataBuilder: newUserRequestedData, |
| 42 | }) |
| 43 | } |
| 44 | |
| 45 | func newUserRequestedData(_ context.Context, data email.NotificationTemplateData) (email.NotificationTemplateData, error) { |
| 46 | var nData ttnpb.CreateUserRequest |
nothing calls this directly
no test coverage detected