Utility scripts for development and testing.
Generates self-signed TLS certificates for local development.
Usage:
./scripts/generate-dev-certs.sh [domain]Example:
./scripts/generate-dev-certs.sh localapi.notifuse.comOutput:
dev-certs/[domain].cert.pem- TLS certificatedev-certs/[domain].key.pem- Private keydev-certs/.env.smtp-relay- Environment variables (base64 encoded)
Sends a test email to the local SMTP relay server.
Usage:
./scripts/test-smtp-relay.sh <workspace_id> <api_key>Example:
./scripts/test-smtp-relay.sh workspace_abc123 "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."Features:
- ✅ Checks server connectivity
- ✅ Uses TLS with proper certificate verification
- ✅ Sends JSON payload with test data
- ✅ Colored output with clear success/failure messages
- ✅ Helpful error messages and debugging tips
Environment Variables:
SMTP_SERVER=localapi.notifuse.com # SMTP server address
SMTP_PORT=587 # SMTP server port
[email protected] # Sender email
[email protected] # Recipient email
NOTIFICATION_ID=password_reset # Notification template IDExample with custom settings:
NOTIFICATION_ID=welcome_email \
[email protected] \
[email protected] \
./scripts/test-smtp-relay.sh workspace_123 "api_key_jwt"Runs multiple SMTP relay test scenarios to verify different features.
Usage:
./scripts/test-smtp-relay-advanced.sh <workspace_id> <api_key>Test Scenarios:
- ✅ Simple notification
- ✅ Full contact details
- ✅ Email headers (CC, BCC, Reply-To)
- ✅ JSON email options
- ✅ Complex data objects
- ✅ Metadata and tags
Example:
./scripts/test-smtp-relay-advanced.sh workspace_abc123 "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."Output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Test 1: Simple Notification
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▶ Testing: Simple notification
✓ Simple notification: PASSED
...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Test Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Passed: 6/6
✓ All tests passed!
Runs integration tests with proper setup and teardown.
Usage:
./scripts/run-integration-tests.sh [test_pattern]Example:
# Run all tests
./scripts/run-integration-tests.sh
# Run specific test
./scripts/run-integration-tests.sh TestBroadcast# macOS
brew install swaks
# Ubuntu/Debian
sudo apt-get install swaks
# Fedora/RHEL
dnf install swaksUsed for connectivity checks.
# macOS (via Homebrew)
brew install netcat
# Ubuntu/Debian
sudo apt-get install netcat./scripts/generate-dev-certs.sh localapi.notifuse.comecho "127.0.0.1 localapi.notifuse.com" | sudo tee -a /etc/hostscat dev-certs/.env.smtp-relay >> .envmake devFirst, get your workspace ID and API key from the application, then:
./scripts/test-smtp-relay.sh your_workspace_id "your_api_key_jwt"chmod +x scripts/*.shInstall swaks (see Prerequisites above).
Ensure:
- SMTP relay is enabled in
.env - Server is running (
make dev) - Domain is in
/etc/hosts - Port 587 is not blocked
Verify:
- Workspace ID is correct
- API key is a valid JWT token
- API key hasn't expired
- JWT secret matches
Use the certificate path:
--tls-ca-path ./dev-certs/localapi.notifuse.com.cert.pemOr disable verification for testing:
--tls-verify=no