{"id":39826188,"url":"https://github.com/dmt-software/laposta-api","last_synced_at":"2026-01-20T17:05:23.111Z","repository":{"id":152686207,"uuid":"622014354","full_name":"dmt-software/laposta-api","owner":"dmt-software","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-04T12:12:30.000Z","size":156,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-04T14:17:25.314Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dmt-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-03-31T22:26:35.000Z","updated_at":"2025-11-04T12:11:44.000Z","dependencies_parsed_at":"2023-11-07T19:26:42.988Z","dependency_job_id":"d91ca889-5244-4bdb-b14f-b8c887169831","html_url":"https://github.com/dmt-software/laposta-api","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/dmt-software/laposta-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmt-software%2Flaposta-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmt-software%2Flaposta-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmt-software%2Flaposta-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmt-software%2Flaposta-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmt-software","download_url":"https://codeload.github.com/dmt-software/laposta-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmt-software%2Flaposta-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28536688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T10:13:46.436Z","status":"ssl_error","status_checked_at":"2026-01-18T10:13:11.045Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-18T13:05:11.309Z","updated_at":"2026-01-18T13:05:11.882Z","avatar_url":"https://github.com/dmt-software.png","language":"PHP","readme":"# Laposta API \n\nAn Object-Oriented client to consume the Laposta API.\n\n## Install\n\n```bash\ncomposer require dmt-software/laposta-api\n```\n\n### Configure\n\nAfter installing this package you need to configure it. The quickest way to do this is simply add a config file and \nuse it to load the config into a `Config` instance.  \n\n```php \n// file: config.php\n\nreturn [\n    'apiKey' =\u003e 'JdMtbsMq2jqJdQZD9AHC',\n    'customFieldsClasses' =\u003e [],\n    'httpClient' =\u003e \\GuzzleHttp\\Client::class,\n    'requestFactory' =\u003e \\GuzzleHttp\\Psr7\\HttpFactory::class,\n];\n```\n\n### Generate entity\n\nThe next step is to generate an entity for the custom fields for the mailing list(s).\n\n```bash\nvendor/bin/laposta generate:list-fields config.php -l BaImMu3JZA\n```\n\nMore in depth information about the custom fields can be found in the subscribers [documentation](/docs/subscribers.md).\n\n## Usage\n\n### Initiate a Client\n\nThe easiest way to create a client instance is using the factories in this package. These factories can also be used (as \nguideline) in a dependency injection container. \n\n```php\nuse DMT\\Laposta\\Api\\Clients\\Subscribers;\nuse DMT\\Laposta\\Api\\Config;\nuse DMT\\Laposta\\Api\\Factories\\CommandBusFactory;\n\n$commandBus = CommandBusFactory::create(Config::load('config.php'));\n\n$client = new Subscribers($commandBus);\n```\n\n### Subscribe a user to a mailing list\n\n```php\nuse DMT\\CommandBus\\Validator\\ValidationException;\nuse DMT\\Laposta\\Api\\Entity\\BaseCustomFields;\nuse DMT\\Laposta\\Api\\Entity\\Subscriber;\nuse DMT\\Laposta\\Api\\Clients\\Subscribers;\nuse Psr\\Http\\Client\\ClientExceptionInterface;\n\ntry {\n    /** @var BaseCustomFields $customFields The generated entity for your list */\n    \n    $subscriber = new Subscriber();\n    $subscriber-\u003elistId = 'BaImMu3JZA';\n    $subscriber-\u003eemail = 'user@example.com';\n    $subscriber-\u003ecustomFields = $customFields;\n    $subscriber-\u003ecustomFields-\u003ename = 'John Do';\n    \n    /** @var Subscribers $client */\n    $client-\u003ecreate($subscriber, Subscribers::OPTION_SUPPRESS_EMAIL_NOTIFICATION);\n} catch (ValidationException $exception) {\n     // input was wrong \n} catch (ClientExceptionInterface $exception) {\n    // error response\n}\n```\n\nMore on how to use this package can be found in the client [documentation](/docs/clients.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmt-software%2Flaposta-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmt-software%2Flaposta-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmt-software%2Flaposta-api/lists"}