{"id":15964332,"url":"https://github.com/luyadev/luya-mailjet","last_synced_at":"2025-03-17T22:30:39.225Z","repository":{"id":32774132,"uuid":"141184316","full_name":"luyadev/luya-mailjet","owner":"luyadev","description":"LUYA and Yii Framework integration for mailjet service.","archived":false,"fork":false,"pushed_at":"2022-06-28T11:40:00.000Z","size":243,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T05:26:06.238Z","etag":null,"topics":["hacktoberfest","luya","mailjet","mailjet-api","yii2"],"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/luyadev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-16T19:28:07.000Z","updated_at":"2021-10-12T06:46:24.000Z","dependencies_parsed_at":"2022-09-01T00:30:39.176Z","dependency_job_id":null,"html_url":"https://github.com/luyadev/luya-mailjet","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luyadev%2Fluya-mailjet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luyadev%2Fluya-mailjet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luyadev%2Fluya-mailjet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luyadev%2Fluya-mailjet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luyadev","download_url":"https://codeload.github.com/luyadev/luya-mailjet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243886556,"owners_count":20363752,"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":["hacktoberfest","luya","mailjet","mailjet-api","yii2"],"created_at":"2024-10-07T17:01:43.168Z","updated_at":"2025-03-17T22:30:38.954Z","avatar_url":"https://github.com/luyadev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/luyadev/luya/master/docs/logo/luya-logo-0.2x.png\" alt=\"LUYA Logo\"/\u003e\n\u003c/p\u003e\n\n# LUYA Mailjet\n\n[![LUYA](https://img.shields.io/badge/Powered%20by-LUYA-brightgreen.svg)](https://luya.io)\n![Tests](https://github.com/luyadev/luya-mailjet/workflows/Tests/badge.svg)\n[![Total Downloads](https://poser.pugx.org/luyadev/luya-mailjet/downloads)](https://packagist.org/packages/luyadev/luya-mailjet)\n[![Latest Stable Version](https://poser.pugx.org/luyadev/luya-mailjet/v/stable)](https://packagist.org/packages/luyadev/luya-mailjet)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/79087433986c16d7f41d/test_coverage)](https://codeclimate.com/github/luyadev/luya-mailjet/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/79087433986c16d7f41d/maintainability)](https://codeclimate.com/github/luyadev/luya-mailjet/maintainability)\n\nLUYA and Yii Framework integration for [Mailjet](https://mailjet.com) service.\n\nContains:\n\n+ Yii Framework BaseMailer for Transaction E-Mails trough API.\n+ Interface for Subscription Mail Sync including CLI command for Synchronisation.\n+ A PHP library to convert MJML content into Mailjet Passport json format.\n+ LUYA Admin Module to convert MJML into HTML based on MJML.io API.\n+ LUYA Active Window to retrieve informations about a given User E-Mail.\n+ A Widget to subscribe to a List with double opt in (can be disabled).\n+ SMS Sending helpers\n+ Yii 2 Queue Job to send mails with a template\n\n## Installation\n\nInstall the extension through composer:\n\n```sh\ncomposer require luyadev/luya-mailjet\n```\n\nAdd to config:\n\n```php\n'components' =\u003e [\n    //...\n    'mailjet' =\u003e [\n        'class' =\u003e 'luya\\mailjet\\Client',\n        'apiKey' =\u003e '...',\n        'apiSecret' =\u003e '...',\n    ],\n    'mailer' =\u003e [\n        'class' =\u003e 'luya\\mailjet\\Mailer',\n    ],\n]\n```\n\n## Basic Send Mail\n\nSending transactional E-Mail:\n\n```php\nYii::$app-\u003emailer-\u003ecompose()\n    -\u003esetFrom('from@domain.com')\n    -\u003esetTo('to@domain.com')\n    -\u003esetSubject('Message subject')\n    -\u003esetTextBody('Plain text content')\n    -\u003esetHtmlBody('\u003cb\u003eHTML content\u003c/b\u003e')\n    -\u003esend();\n```\n\nSend a transactional E-Mail based on the Template id stored in Mailjet:\n\n```php\nYii::$app-\u003emailer-\u003ecompose()\n    -\u003esetTemplate(484590)\n    -\u003esetVariables(['lastname' =\u003e 'Lastname Value'])\n    -\u003esetTo(['to@domain.com'])\n    -\u003esend();\n```\n\n## MJML to HTML\n\nWith version 1.3 of LUYA Mailjet library there is an admin module you can configured in order to parser MJML into HTML, therefore add the module to your configuration and provide mjml.io API keys:\n\n```php\n'modules' =\u003e [\n    //...\n    'mailjetadmin' =\u003e [\n        'class' =\u003e 'luya\\mailjet\\admin\\Module',\n        'mjmlApiApplicationId' =\u003e 'ApplicationIdFromMjml.io',\n        'mjmlApiSecretKey' =\u003e 'ApplicationSecretFromMjml.io',\n    ]\n]\n```\n\nAfterwards you can retrieve and render the HTML of MJML template with:\n\n```php\nluya\\mailjet\\models\\Template::renderHtml('slug', ['foo' =\u003e 'bar']);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluyadev%2Fluya-mailjet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluyadev%2Fluya-mailjet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluyadev%2Fluya-mailjet/lists"}