{"id":15042146,"url":"https://github.com/tigrov/yii2-mailqueue","last_synced_at":"2025-04-10T00:24:01.339Z","repository":{"id":56087481,"uuid":"71615726","full_name":"Tigrov/yii2-mailqueue","owner":"Tigrov","description":"Yii2 mail queue component for yii2-swiftmailer.","archived":false,"fork":false,"pushed_at":"2024-10-18T11:18:25.000Z","size":18,"stargazers_count":16,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T22:44:37.986Z","etag":null,"topics":["mail","queue","yii2","yii2-extension"],"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/Tigrov.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}},"created_at":"2016-10-22T04:02:07.000Z","updated_at":"2024-12-30T03:52:49.000Z","dependencies_parsed_at":"2024-11-13T14:54:39.794Z","dependency_job_id":"78a72a64-7c7a-4fd3-ae48-cf874063aadd","html_url":"https://github.com/Tigrov/yii2-mailqueue","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":0.2941176470588235,"last_synced_commit":"c213d5fcab034ec44297af13d6a80c5c191dc687"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tigrov%2Fyii2-mailqueue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tigrov%2Fyii2-mailqueue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tigrov%2Fyii2-mailqueue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tigrov%2Fyii2-mailqueue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tigrov","download_url":"https://codeload.github.com/Tigrov/yii2-mailqueue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248132438,"owners_count":21053042,"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":["mail","queue","yii2","yii2-extension"],"created_at":"2024-09-24T20:46:54.408Z","updated_at":"2025-04-10T00:24:01.320Z","avatar_url":"https://github.com/Tigrov.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"yii2-mailqueue\n==============\n\nYii2 mail queue component for [yii2-symfonymailer](https://www.yiiframework.com/extension/yiisoft/yii2-symfonymailer).\n\n[![Latest Stable Version](https://poser.pugx.org/Tigrov/yii2-mailqueue/v/stable)](https://packagist.org/packages/Tigrov/yii2-mailqueue)\n\nLimitation\n------------\n\nSince 1.1.6 requires PHP \u003e= 8.1\n\nInstallation\n------------\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\nphp composer.phar require --prefer-dist tigrov/yii2-mailqueue \"~1.1.1\"\n```\n\nor add\n\n```\n\"tigrov/yii2-mailqueue\": \"~1.1.6\"\n```\n\nto the require section of your `composer.json` file.\n\n \nConfiguration\n-------------\nOnce the extension is installed, add following code to your application configuration:\n\n```php\nreturn [\n    // ...\n    'components' =\u003e [\n        'mailer' =\u003e [\n            'class' =\u003e 'tigrov\\mailqueue\\Mailer',\n            'table' =\u003e '{{%mail_queue}}',\n            'maxAttempts' =\u003e 5,\n            'attemptIntervals' =\u003e [0, 'PT10M', 'PT1H', 'PT6H'],\n            'removeFailed' =\u003e true,\n            'maxPerPeriod' =\u003e 10,\n            'periodSeconds' =\u003e 1,\n        ],\n    ],\n    // ...\n];\n```\n\nFollowing properties are available for customizing the mail queue behavior.\n\n* `table` name of the database table to store emails added to the queue;\n* `maxAttempts` maximum number of sending attempts per email;\n* `attemptIntervals` seconds or interval specifications to delay between attempts to send a mail message, see http://php.net/manual/en/dateinterval.construct.php;\n* `removeFailed` indicator to remove mail messages which were not sent in `maxAttempts`;\n* `maxPerPeriod` number of mail messages which could be sent per `periodSeconds`;\n* `periodSeconds` period in seconds which indicate the time interval for `maxPerPeriod` option.\n\n\nUpdating database schema\n------------------------\n\nRun `yii migrate` command in command line:\n\n```\nphp yii migrate/up --migrationPath=@vendor/tigrov/yii2-mailqueue/src/migrations/\n```\n\nSending the mail queue\n-------------------------\n\nTo sending mails from the queue call `Yii::$app-\u003emailer-\u003esending()` or run the console command `yii mailqueue` which can be triggered by a CRON job:\n\n```\n* * * * * php /var/www/vhosts/domain.com/yii mailqueue/sending\n```\n\nAfter the mail message successfully sent it will be deleted from the queue.\n\nUsage\n-----\n\nYou can then send a mail to the queue as follows:\n\n```php\nYii::$app-\u003emailer-\u003ecompose('contact/html')\n     -\u003esetFrom('from@domain.com')\n     -\u003esetTo($form-\u003eemail)\n     -\u003esetSubject($form-\u003esubject)\n     -\u003esetTextBody($form-\u003ebody)\n     -\u003edelay('PT3M') // seconds or an interval specification to delay of sending the mail message, see http://php.net/manual/en/dateinterval.construct.php\n     -\u003eunique('unique key') // a unique key for the mail message, new message with the same key will replace the old one\n     -\u003equeue();\n```\n\nYou can still send mails directly with `yii2-swiftmailer`:\n\n```php\nYii::$app-\u003emailer-\u003ecompose('contact/html')\n     -\u003esetFrom('from@domain.com')\n     -\u003esetTo($form-\u003eemail)\n     -\u003esetSubject($form-\u003esubject)\n     -\u003esetTextBody($form-\u003ebody)\n     -\u003esend();\n```\n\nLicense\n-------\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftigrov%2Fyii2-mailqueue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftigrov%2Fyii2-mailqueue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftigrov%2Fyii2-mailqueue/lists"}