Skip to main content

Notifuse Scripts

Download

Download Notifuse Scripts — zip containing the script and README.

Scripts for fetching and managing data from the Notifuse email platform API.

Setup

  1. Add your Notifuse API key to the project .env file:

    NOTIFUSE_API_KEY=your_api_key_here
  2. Ensure jq and curl are installed:

    # macOS
    brew install jq

    # Linux
    apt-get install jq curl
  3. 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 details
  • exports/email-providers-{timestamp}.json - Email provider configuration
  • exports/lists-{timestamp}.json - All lists with contact counts
  • exports/contacts-summary-{timestamp}.json - Contacts summary
  • exports/templates-{timestamp}.json - Email templates
  • exports/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 contacts
  • exports/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 key
  • NOTIFUSE_BASE_URL - Optional. Defaults to https://email.pacing.agency/api

API Endpoints Used

The scripts interact with the following Notifuse API endpoints:

  • GET /api/workspaces - List workspaces
  • GET /api/lists - List all lists
  • GET /api/lists/{id}/contacts - Get contacts from a list
  • GET /api/contacts - List contacts (with optional list_id parameter)
  • GET /api/broadcasts.list or GET /api/broadcasts - List campaigns
  • GET /api/templates - List email templates
  • GET /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 .env file exists in project root
  • Verify NOTIFUSE_API_KEY is 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) or apt-get install jq (Linux)