Notifuse Scripts
Download Notifuse Scripts — zip containing the script and README.
Scripts for fetching and managing data from the Notifuse email platform API.
Setup
-
Add your Notifuse API key to the project
.envfile:NOTIFUSE_API_KEY=your_api_key_here -
Ensure
jqandcurlare installed:# macOS
brew install jq
# Linux
apt-get install jq curl -
Make scripts executable:
chmod +x scripts/resources/notifuse/*.sh
Scripts
fetch-account-info.sh
Fetches comprehensive account information including:
- Workspace configuration
- Email provider settings
- Lists summary with contact counts
- Templates summary
Usage:
./scripts/resources/notifuse/fetch-account-info.sh
Output (saved to exports/ directory):
exports/workspaces-{timestamp}.json- Workspace detailsexports/email-providers-{timestamp}.json- Email provider configurationexports/lists-{timestamp}.json- All lists with contact countsexports/contacts-summary-{timestamp}.json- Contacts summaryexports/templates-{timestamp}.json- Email templatesexports/account-summary-{timestamp}.json- Combined summary
fetch-lists.sh
Fetches all lists with detailed information including contact counts, public/private status, and creation dates.
Usage:
./scripts/resources/notifuse/fetch-lists.sh
Output (saved to exports/ directory):
exports/lists-{timestamp}.json- All lists with full details
fetch-contacts.sh
Fetches contacts from lists. Can fetch from a specific list or all lists.
Usage:
# Fetch from all lists
./scripts/resources/notifuse/fetch-contacts.sh
# Fetch from a specific list
./scripts/resources/notifuse/fetch-contacts.sh {list_id}
Output (saved to exports/ directory):
exports/contacts/all-contacts-{timestamp}.json- All contactsexports/contacts/list-{list_id}-{list_name}-{timestamp}.json- Contacts for each list
fetch-campaigns.sh
Fetches broadcast campaigns with statistics and status information.
Usage:
./scripts/resources/notifuse/fetch-campaigns.sh
Output (saved to exports/ directory):
exports/campaigns-{timestamp}.json- All campaigns with details
Environment Variables
All scripts use the following environment variables (loaded from .env):
NOTIFUSE_API_KEY- Required. Your Notifuse API keyNOTIFUSE_BASE_URL- Optional. Defaults tohttps://email.pacing.agency/api
API Endpoints Used
The scripts interact with the following Notifuse API endpoints:
GET /api/workspaces- List workspacesGET /api/lists- List all listsGET /api/lists/{id}/contacts- Get contacts from a listGET /api/contacts- List contacts (with optional list_id parameter)GET /api/broadcasts.listorGET /api/broadcasts- List campaignsGET /api/templates- List email templatesGET /api/email-providers- List email provider configurations
Note: Some endpoints may vary based on your Notifuse version. Adjust the scripts if endpoints return 404 errors.
Error Handling
All scripts:
- Check for required dependencies (
jq,curl) - Validate API key is present
- Handle HTTP errors gracefully
- Save output even if some endpoints fail
Output Format
All JSON output files are saved to the exports/ directory and formatted with jq for readability. Timestamps are in format YYYYMMDD-HHMMSS.
Directory Structure:
scripts/resources/notifuse/
├── exports/ # All JSON export files
│ ├── contacts/ # Contact exports
│ ├── account-summary-*.json
│ ├── contacts-summary-*.json
│ ├── lists-*.json
│ ├── templates-*.json
│ └── ...
├── fetch-account-info.sh
├── fetch-lists.sh
├── fetch-contacts.sh
├── fetch-campaigns.sh
└── README.md
Troubleshooting
API key not found:
- Ensure
.envfile exists in project root - Verify
NOTIFUSE_API_KEYis set in.env - Check file permissions on
.env
Endpoint not found (404):
- API endpoints may vary by Notifuse version
- Check Notifuse API documentation for correct endpoints
- Update script endpoint paths as needed
jq command not found:
- Install jq:
brew install jq(macOS) orapt-get install jq(Linux)
Related Documentation
- Notifuse tool documentation: Notifuse
- Notifuse API documentation: https://docs.notifuse.com