MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / senderIdentityEventFirer

Function senderIdentityEventFirer

cmd/e2a/main.go:97–109  ·  view source on GitHub ↗
(pub webhookpub.Publisher)

Source from the content-addressed store, hash-verified

95}
96
97func senderIdentityEventFirer(pub webhookpub.Publisher) senderidentity.EventFirer {
98 return func(ctx context.Context, domain, userID string, status senderidentity.Status, errMsg string) {
99 eventType := webhookpub.EventDomainSendingVerified
100 data := map[string]any{"domain": domain, "sending_status": string(status)}
101 if status == senderidentity.StatusFailed {
102 eventType = webhookpub.EventDomainSendingFailed
103 if errMsg != "" {
104 data["error"] = errMsg
105 }
106 }
107 pub.Publish(ctx, webhookpub.NewEvent(eventType, userID, data))
108 }
109}
110
111func main() {
112 // Load .env file if present (development convenience, not required)

Callers 1

mainFunction · 0.85

Calls 2

NewEventFunction · 0.92
PublishMethod · 0.65

Tested by

no test coverage detected