{"id":22794538,"url":"https://github.com/alekitto/mjml-php","last_synced_at":"2025-06-12T06:07:50.446Z","repository":{"id":266571630,"uuid":"898730448","full_name":"alekitto/mjml-php","owner":"alekitto","description":"PHP extension to render MJML emails","archived":false,"fork":false,"pushed_at":"2025-05-29T22:22:17.000Z","size":73,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T22:07:05.176Z","etag":null,"topics":["email","mjml","mjml-to-html","php","php-ext","php-extension"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/alekitto.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}},"created_at":"2024-12-04T23:31:34.000Z","updated_at":"2025-05-29T22:22:20.000Z","dependencies_parsed_at":"2025-05-29T23:21:33.778Z","dependency_job_id":"087dae9e-2332-4dda-9327-8ffadb5cf5d3","html_url":"https://github.com/alekitto/mjml-php","commit_stats":null,"previous_names":["alekitto/mjml-php"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/alekitto/mjml-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekitto%2Fmjml-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekitto%2Fmjml-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekitto%2Fmjml-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekitto%2Fmjml-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alekitto","download_url":"https://codeload.github.com/alekitto/mjml-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekitto%2Fmjml-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259409991,"owners_count":22852967,"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":["email","mjml","mjml-to-html","php","php-ext","php-extension"],"created_at":"2024-12-12T04:09:10.346Z","updated_at":"2025-06-12T06:07:50.410Z","avatar_url":"https://github.com/alekitto.png","language":"Rust","readme":"# mjml-php\n\nPHP wrapper for [MRML](https://github.com/jdrouet/mrml), the [MJML](https://mjml.io) implementation in Rust.\nRust needs to be available to build this extension from source.\n\n## Building, extending PHP\n\n```sh\n$ phpize\n$ ./configure\n$ make\n$ make install\n# in php.ini set extension=mjml.so or:\n$ php -dextension=path-to-project/target/release/mjml.so \u003cyour php file\u003e\n```\n\n# PHP\n\n```php\n\u003c?php\n\n$mjml = new Mjml\\Mjml();\n$rendered = $mjml-\u003erender('\u003cmjml\u003e\u003cmj-body\u003e\u003cmj-text\u003eHello world!\u003c/mj-text\u003e\u003c/mj-body\u003e\u003c/mjml\u003e');\n\necho $rendered; // Email-friendly HTML\n```\n\n## Classes and Methods\n\nThe extension exposes a `Mjml\\Mjml` class to parse and render mjml into HTML. You can use the following methods:\n\n- `public function render(string $mjml): Mjml\\Email`: render a mjml string into HTML\n- `public function renderFile(string $path): Mjml\\Email`: read the specified file and render the mjml content into HTML (stream wrappers are supported).\n- `public static function defaultFonts(): array`: returns a hashmap with the default fonts\n\n`render` and `renderFile` methods return a `Mjml\\Email` object which exposes the following methods:\n\n- `public function getTitle(): string|null`: returns the content of the `\u003cmj-title\u003e` tag, if set\n- `public function getPreview(): string|null`: returns the content of the `\u003cmj-preview\u003e` tag, if present\n- `public function getBody(): string`: returns the HTML email body\n\n## Options\n\nWhile constructing the Mjml object, you can pass an array with the following options:\n\n| Option             | Description                                         | Default                                                   |\n|--------------------|-----------------------------------------------------|-----------------------------------------------------------|\n| disable_comments   | If true, do not include comments in the HTML output | false                                                     |\n| social_icon_origin | Base URL for mj-social-element images               | https://www.mailjet.com/images/theme/v1/icons/ico-social/ |\n| fonts              | Key-value array of fonts used in the email body     | See [default fonts](#default-fonts)                       |\n\n### Default fonts\n\nBy default, this library uses the following fonts:\n\n| Font name  | URL                                                                |\n|------------|--------------------------------------------------------------------|\n| Open Sans  | https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700  |\n| Droid Sans | https://fonts.googleapis.com/css?family=Droid+Sans:300,400,500,700 |\n| Lato       | https://fonts.googleapis.com/css?family=Lato:300,400,500,700       |\n| Roboto     | https://fonts.googleapis.com/css?family=Roboto:300,400,500,700     | \n| Ubuntu     | https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700     |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falekitto%2Fmjml-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falekitto%2Fmjml-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falekitto%2Fmjml-php/lists"}