Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ This SDK includes the following components:
- [Opt-In Handler](docs/OptInHandler.md)
- [Domains](docs/Domains.md)
- [Webhooks](docs/Webhooks.md)
- [Account Webhooks](docs/AccountWebhooks.md)
- [Events](docs/Events.md)
- [Snippets](docs/Snippets.md)
- [Subaccounts](docs/Subaccounts.md)
Expand Down
55 changes: 55 additions & 0 deletions docs/AccountWebhooks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Mailgun - Account Webhooks
====================

This is the Mailgun Ruby *Account Webhook* utilities.

The below assumes you've already installed the Mailgun Ruby SDK in to your
project. If not, go back to the master README for instructions.

Usage - Account Webhooks
-----------------------

```ruby
# First, instantiate the Mailgun Client with your API key
mg_client = Mailgun::Client.new('your-api-key')
hook = Mailgun::AccountWebhooks.new(mg_client)

```

Account Webhooks methods:

```ruby
# List account-level webhooks
hook.list
hook.list('id1, id2')

# Create an account-level webhook
hook.create(
description: 'desc',
event_types: 'accepted',
url: 'https://the.webhook.url/'
)

# Delete account-level webhooks
hook.remove(all: true)
hook.remove('id1, id2')

# Get account-level webhook by ID
hook.get('id1')

# Update an account-level webhook
hook.update(
'hook',
description: 'desc',
event_types: 'accepted',
url: 'https://the.webhook.url/'
)

# Delete account-level webhook by ID
hook.remove_by_id('id1')
```

More Documentation
------------------
See the official [Mailgun Account Webhooks Docs](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-webhooks)
for more information
2 changes: 1 addition & 1 deletion docs/Webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ hook.remove_all 'my.perfect.domain'

More Documentation
------------------
See the official [Mailgun Domain Docs](https://documentation.mailgun.com/en/latest/api-webhooks.html)
See the official [Mailgun Webhooks Docs](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domain-webhooks)
for more information