{"id":20040434,"url":"https://github.com/postalserver/postal-php","last_synced_at":"2025-04-09T10:05:09.981Z","repository":{"id":44745596,"uuid":"88881240","full_name":"postalserver/postal-php","owner":"postalserver","description":"A PHP library for the Postal e-mail platform","archived":false,"fork":false,"pushed_at":"2024-10-01T13:19:42.000Z","size":35,"stargazers_count":72,"open_issues_count":0,"forks_count":27,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-02T08:01:41.916Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/postalserver.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2017-04-20T15:25:59.000Z","updated_at":"2025-03-14T10:57:50.000Z","dependencies_parsed_at":"2024-12-09T00:05:42.577Z","dependency_job_id":"04d08cdc-ca6e-4958-95eb-b1416899ce0a","html_url":"https://github.com/postalserver/postal-php","commit_stats":{"total_commits":22,"total_committers":6,"mean_commits":"3.6666666666666665","dds":0.5909090909090908,"last_synced_commit":"bb664406d35f763d9a7420fb7eeac67f34279b13"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postalserver%2Fpostal-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postalserver%2Fpostal-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postalserver%2Fpostal-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postalserver%2Fpostal-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/postalserver","download_url":"https://codeload.github.com/postalserver/postal-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248018060,"owners_count":21034048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-13T10:42:14.172Z","updated_at":"2025-04-09T10:05:09.943Z","avatar_url":"https://github.com/postalserver.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postal for PHP\n\nThis library helps you send e-mails through [Postal](https://github.com/postalserver/postal) in PHP 7.4 and above.\n\n## Installation\n\nInstall the library using [Composer](https://getcomposer.org/):\n\n```\n$ composer require postal/postal\n```\n\n## Usage\n\nSending an email is very simple. Just follow the example below. Before you can begin, you'll\nneed to login to our web interface and generate a new API credential.\n\n```php\n// Create a new Postal client using the server key you generate in the web interface\n$client = new Postal\\Client('https://postal.yourdomain.com', 'your-api-key');\n\n// Create a new message\n$message = new Postal\\Send\\Message();\n\n// Add some recipients\n$message-\u003eto('john@example.com');\n$message-\u003eto('mary@example.com');\n$message-\u003ecc('mike@example.com');\n$message-\u003ebcc('secret@awesomeapp.com');\n\n// Specify who the message should be from. This must be from a verified domain\n// on your mail server.\n$message-\u003efrom('test@test.postal.io');\n\n// Set the subject\n$message-\u003esubject('Hi there!');\n\n// Set the content for the e-mail\n$message-\u003eplainBody('Hello world!');\n$message-\u003ehtmlBody('\u003cp\u003eHello world!\u003c/p\u003e');\n\n// Add any custom headers\n$message-\u003eheader('X-PHP-Test', 'value');\n\n// Attach any files\n$message-\u003eattach('textmessage.txt', 'text/plain', 'Hello world!');\n\n// Send the message and get the result\n$result = $client-\u003esend-\u003emessage($message);\n\n// Loop through each of the recipients to get the message ID\nforeach ($result-\u003erecipients() as $email =\u003e $message) {\n    $email;          // The e-mail address of the recipient\n    $message-\u003eid;    // The message ID\n    $message-\u003etoken; // The message's token\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostalserver%2Fpostal-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpostalserver%2Fpostal-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostalserver%2Fpostal-php/lists"}