Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add / Configure webhooks #14

Open
18 tasks done
michaelwalkerfl opened this issue Jan 21, 2016 · 0 comments
Open
18 tasks done

Add / Configure webhooks #14

michaelwalkerfl opened this issue Jan 21, 2016 · 0 comments
Milestone

Comments

@michaelwalkerfl
Copy link

We need to add webhooks around each model event and also any other important API calls. Example:

package subscriber

import (
    "crowdstart.com/util/webhook"
)

// Hooks
func (s *Subscriber) AfterCreate() error {
    return webhook.Emit(s.Context(), s.Namespace(), "subscriber.created", s)
}

func (s *Subscriber) AfterUpdate(previous *Subscriber) error {
    return webhook.Emit(s.Context(), s.Namespace(), "subscriber.updated", s, prev)
}

func (s *Subscriber) AfterDelete() error {
    return webhook.Emit(s.Context(), s.Namespace(), "subscriber.deleted", s)
}

Models that need this:

  • bundle
  • collection
  • coupon
  • mailinglist
  • order
  • organization (only in default namespace)
  • payment
  • plan
  • product
  • referral
  • referrer
  • site
  • store
  • submission
  • subscriber
  • transaction
  • user (also in default namespace)
  • variant
@zeekay zeekay changed the title Dash: Add / Configure webhooks Add / Configure webhooks Jan 22, 2016
@zeekay zeekay modified the milestone: MVP Jan 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants