MCPcopy Index your code
hub / github.com/coder/coder / sendInboxNotification

Function sendInboxNotification

scaletest/notifications/run_test.go:327–347  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T, db database.Store, inboxHandler *dispatch.InboxHandler, username string, templateID uuid.UUID)

Source from the content-addressed store, hash-verified

325}
326
327func sendInboxNotification(ctx context.Context, t *testing.T, db database.Store, inboxHandler *dispatch.InboxHandler, username string, templateID uuid.UUID) error {
328 user, err := db.GetUserByEmailOrUsername(ctx, database.GetUserByEmailOrUsernameParams{
329 Username: username,
330 })
331 require.NoError(t, err)
332
333 dispatchFunc, err := inboxHandler.Dispatcher(types.MessagePayload{
334 UserID: user.ID.String(),
335 NotificationTemplateID: templateID.String(),
336 }, "", "", nil)
337 if err != nil {
338 return err
339 }
340
341 _, err = dispatchFunc(ctx, uuid.New())
342 if err != nil {
343 return err
344 }
345
346 return nil
347}

Callers 2

TestRunFunction · 0.85
TestRunWithSMTPFunction · 0.85

Calls 4

DispatcherMethod · 0.65
NewMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected