MCPcopy
hub / github.com/knadh/listmonk / GetSubscriber

Method GetSubscriber

cmd/subscribers.go:59–77  ·  view source on GitHub ↗

GetSubscriber handles the retrieval of a single subscriber by ID.

(c echo.Context)

Source from the content-addressed store, hash-verified

57
58// GetSubscriber handles the retrieval of a single subscriber by ID.
59func (a *App) GetSubscriber(c echo.Context) error {
60 user := auth.GetUser(c)
61
62 // Check if the user has access to at least one of the lists on the subscriber.
63 id := getID(c)
64 if err := a.hasSubPerm(user, []int{id}); err != nil {
65 return err
66 }
67
68 // Fetch the subscriber from the DB.
69 out, err := a.core.GetSubscriber(id, "", "")
70 if err != nil {
71 return err
72 }
73
74 maskRestrictedSubLists(user, &out)
75
76 return c.JSON(http.StatusOK, okResp{out})
77}
78
79// GetSubscriberActivity handles the retrieval of a subscriber's campaign views and link clicks.
80func (a *App) GetSubscriberActivity(c echo.Context) error {

Callers 8

ViewCampaignMessageMethod · 0.45
SubscriptionPageMethod · 0.45
SubscriptionPrefsMethod · 0.45
processSubFormMethod · 0.45
SendTxMessageMethod · 0.45
hasSubMethod · 0.45
PatchSubscriberMethod · 0.45
SubscriberSendOptinMethod · 0.45

Calls 5

hasSubPermMethod · 0.95
GetUserFunction · 0.92
getIDFunction · 0.85
maskRestrictedSubListsFunction · 0.85
JSONMethod · 0.80

Tested by

no test coverage detected