{"id":50673750,"url":"https://github.com/jkaninda/posta-php","last_synced_at":"2026-06-08T14:01:44.181Z","repository":{"id":344543570,"uuid":"1182159850","full_name":"jkaninda/posta-php","owner":"jkaninda","description":"Posta PHP Client","archived":false,"fork":false,"pushed_at":"2026-03-15T07:15:14.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-15T17:39:53.917Z","etag":null,"topics":["email-marketing","email-sender","email-templates","php","posta","posta-client","posta-php-client"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jkaninda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-15T05:46:55.000Z","updated_at":"2026-03-15T06:00:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jkaninda/posta-php","commit_stats":null,"previous_names":["jkaninda/posta-php"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jkaninda/posta-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkaninda%2Fposta-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkaninda%2Fposta-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkaninda%2Fposta-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkaninda%2Fposta-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkaninda","download_url":"https://codeload.github.com/jkaninda/posta-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkaninda%2Fposta-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34065354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email-marketing","email-sender","email-templates","php","posta","posta-client","posta-php-client"],"created_at":"2026-06-08T14:01:41.654Z","updated_at":"2026-06-08T14:01:44.159Z","avatar_url":"https://github.com/jkaninda.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Posta PHP Client\n\nA lightweight PHP client for the [Posta](https://github.com/jkaninda/posta) email API.\n\n## Requirements\n\n- PHP 8.1+\n- `ext-curl`\n- `ext-json`\n\n## Installation\n\n### Composer\n\n```bash\ncomposer require jkaninda/posta-php\n```\n\n### Manual\n\nCopy `src/PostaClient.php` and `src/PostaException.php` into your project and include them.\n\n## Usage\n\n```php\nuse Posta\\PostaClient;\n\n$client = new PostaClient('https://posta.example.com', 'your-api-key');\n```\n\n### Send Email\n\n```php\n$response = $client-\u003esendEmail([\n    'from'    =\u003e 'sender@example.com',\n    'to'      =\u003e ['recipient@example.com'],\n    'subject' =\u003e 'Hello',\n    'html'    =\u003e '\u003ch1\u003eHello World\u003c/h1\u003e',\n]);\n// $response = ['id' =\u003e '...', 'status' =\u003e 'queued']\n```\n\n### Send Template Email\n\n```php\n$response = $client-\u003esendTemplateEmail([\n    'template'      =\u003e 'welcome',\n    'to'            =\u003e ['user@example.com'],\n    'template_data' =\u003e ['name' =\u003e 'John'],\n]);\n```\n\n### Send Batch Emails\n\n```php\n$response = $client-\u003esendBatch([\n    'template'   =\u003e 'newsletter',\n    'recipients' =\u003e [\n        ['email' =\u003e 'alice@example.com', 'template_data' =\u003e ['name' =\u003e 'Alice']],\n        ['email' =\u003e 'bob@example.com',   'template_data' =\u003e ['name' =\u003e 'Bob']],\n    ],\n]);\n// $response = ['total' =\u003e 2, 'sent' =\u003e 2, 'failed' =\u003e 0, ...]\n```\n\n### Get Email Status\n\n```php\n$status = $client-\u003egetEmailStatus('email-uuid');\n// $status = ['id' =\u003e '...', 'status' =\u003e 'sent', 'retry_count' =\u003e 0, ...]\n```\n\n### Error Handling\n\n```php\nuse Posta\\PostaException;\n\ntry {\n    $client-\u003esendEmail([...]);\n} catch (PostaException $e) {\n    echo $e-\u003egetStatusCode(); // HTTP status code\n    echo $e-\u003egetMessage();    // Error message\n    $info = $e-\u003egetErrorInfo(); // Parsed error details (nullable)\n}\n```\n\n## Contributing\n\nContributions are welcome! Please open an issue to discuss proposed changes before submitting a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See [LICENSE](LICENSE) for details.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Made with ❤️ for the developer community**\n\n⭐ **Star us on GitHub** — it motivates us to keep improving!\n\nCopyright © 2026 Jonas Kaninda\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkaninda%2Fposta-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkaninda%2Fposta-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkaninda%2Fposta-php/lists"}