{"id":15063314,"url":"https://github.com/mailmotor/mailmotor-bundle","last_synced_at":"2025-04-10T10:51:08.191Z","repository":{"id":33876908,"uuid":"37586659","full_name":"mailmotor/mailmotor-bundle","owner":"mailmotor","description":"[Core] This Symfony bundle loads in Mailmotor as a service. So you can subscribe/unsubscribe members to any mailinglist managing API. F.e.: MailChimp, CampaignMonitor, ...","archived":false,"fork":false,"pushed_at":"2025-03-31T19:27:32.000Z","size":141,"stargazers_count":3,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T20:29:43.733Z","etag":null,"topics":["campaign-monitor","mail-engine","mailchimp","mailinglist","php","symfony-bundle"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/mailmotor/mailmotor-bundle","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/mailmotor.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":"2015-06-17T09:47:12.000Z","updated_at":"2025-03-31T19:25:01.000Z","dependencies_parsed_at":"2023-11-27T19:28:00.105Z","dependency_job_id":"262b1eb5-bcd8-4a47-86f2-ddae33b6f0ac","html_url":"https://github.com/mailmotor/mailmotor-bundle","commit_stats":{"total_commits":102,"total_committers":7,"mean_commits":"14.571428571428571","dds":0.4607843137254902,"last_synced_commit":"b053bf1796828992eb0cbcc03c001674ccf74bc6"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailmotor%2Fmailmotor-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailmotor%2Fmailmotor-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailmotor%2Fmailmotor-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailmotor%2Fmailmotor-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mailmotor","download_url":"https://codeload.github.com/mailmotor/mailmotor-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248203285,"owners_count":21064555,"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":["campaign-monitor","mail-engine","mailchimp","mailinglist","php","symfony-bundle"],"created_at":"2024-09-24T23:54:53.462Z","updated_at":"2025-04-10T10:51:08.170Z","avatar_url":"https://github.com/mailmotor.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MailMotorBundle\n\n[![Latest Stable Version](http://img.shields.io/packagist/v/mailmotor/mailmotor-bundle.svg)](https://packagist.org/packages/mailmotor/mailmotor-bundle)\n[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/mailmotor/mailmotor-bundle/blob/master/LICENSE)\n[![Build Status](https://travis-ci.org/mailmotor/mailmotor-bundle.svg?branch=new-version)](https://travis-ci.org/mailmotor/mailmotor-bundle)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mailmotor/mailmotor-bundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mailmotor/mailmotor-bundle/?branch=master)\n\n\u003e Subscribing/Unsubscribing to your own mailinglist has never been this easy! Thanks to this Symfony bundle.\n\n## Installation\n\n### How to configure MailChimp\n\n```bash\ncomposer require mailmotor/mailchimp-bundle\n```\n\n```php\n// In `app/AppKernel.php`\npublic function registerBundles()\n{\n    $bundles = array(\n        // ...\n        new MailMotor\\Bundle\\MailMotorBundle\\MailMotorMailMotorBundle(),\n        new MailMotor\\Bundle\\MailChimpBundle\\MailMotorMailChimpBundle(),\n    );\n```\n\n```yaml\n# In `app/config/parameters.yml`\nparameters:\n  # ...\n  mailmotor.mail_engine:  'mailchimp' # or another mailmotor engine\n  mailmotor.api_key:      xxx # enter your mailchimp api_key here\n  mailmotor.list_id:      xxx # enter the mailchimp default list_id here\n```\n\n## Examples\n\n### Subscribing\n\n```php\n$this-\u003eget('mailmotor.subscriber')-\u003esubscribe(\n    $email,         // f.e.: 'info@jeroendesloovere.be'\n    $language,      // f.e.: 'nl'\n    $mergeFields,   // f.e.: ['FNAME' =\u003e 'Jeroen', 'LNAME' =\u003e 'Desloovere']\n    $interests,     // f.e.: ['9A28948d9' =\u003e true, '8998ASAA' =\u003e false]\n    $doubleOptin,   // OPTIONAL, default = true\n    $listId         // OPTIONAL, default listId is in your config parameters\n);\n```\n\n### Unsubscribing\n\n```php\n$this-\u003eget('mailmotor.subscriber')-\u003eunsubscribe(\n    $email,\n    $listId // OPTIONAL, default listId is in your config parameters\n);\n```\n\n### Exists\n\n```php\n$this-\u003eget('mailmotor.subscriber')-\u003eexists(\n    $email,\n    $listId // OPTIONAL, default listId is in your config parameters\n);\n```\n\n### Is subscribed\n\n```php\n$this-\u003eget('mailmotor.subscriber')-\u003eisSubscribed(\n    $email,\n    $listId // OPTIONAL, default listId is in your config parameters\n);\n```\n\n### Full example for subscribing\n\n```php\nuse MailMotor\\Bundle\\MailMotorBundle\\Exception\\NotImplementedException;\n\n// Don't forget to add validation to your $email\n$email = 'info@jeroendesloovere.be';\n\ntry {\n    if ($this-\u003eget('mailmotor.subscriber')-\u003eisSubscribed($email)) {\n        // Add error to your form\n    }\n// Fallback for when no mailmotor parameters are defined\n} catch (NotImplementedException $e) {\n    // Do nothing\n}\n\nif ($noErrors)\n    try {\n        // Subscribe the user to our default group\n        $this-\u003eget('mailmotor.subscriber')-\u003esubscribe(\n            $email,\n            $language,\n            $mergeFields\n        );\n    // Fallback for when no mailmotor parameters are defined\n    } catch (NotImplementedException $e) {\n        // Add you own code here to f.e.: send a mail to the admin\n    }\n}\n```\n\n### Full example for unsubscribing\n\n```php\nuse MailMotor\\Bundle\\MailMotorBundle\\Exception\\NotImplementedException;\n\n// Don't forget to add validation to your $email\n$email = 'info@jeroendesloovere.be';\n\ntry {\n    // Email exists\n    if ($this-\u003eget('mailmotor.subscriber')-\u003eexists($email)) {\n        // User is already unsubscribed\n        if ($this-\u003eget('mailmotor.subscriber')-\u003eisUnsubscribed($email)) {\n            // Add error to your form: \"User is already unsubscribed\"\n        }\n    // Email not exists\n    } else {\n        // Add error to your form: \"email is not in mailinglist\"\n    }\n// Fallback for when no mailmotor parameters are defined\n} catch (NotImplementedException $e) {\n    // Do nothing\n}\n\nif ($noErrors) {\n    try {\n        // Unsubscribe the user\n        $this-\u003eget('mailmotor.subscriber')-\u003eunsubscribe($email);\n    // Fallback for when no mailmotor parameters are defined\n    } catch (NotImplementedException $e) {\n        // We can send a mail to the admin instead\n    }\n}\n```\n\n## Extending\n\n### Creating a bundle for another mail engine.\n\nF.e.: You want to use a mail engine called \"Crazy\".\n\n```php\npublic function registerBundles()\n{\n    $bundles = array(\n        // ...\n        new Crazy\\Bundle\\MailMotorBundle\\CrazyMailMotorBundle(),\n    );\n```\n\nIn **app/config/parameters.yml**\n\n```yaml\nmailmotor.mail_engine:  'crazy'\nmailmotor.api_key:      xxx # enter your crazy api_key here\nmailmotor.list_id:      xxx # enter the crazy default list_id here\n```\n\nThen you just need to duplicate all files from another mail engine, like f.e.: \"mailmotor/mailchimp-bundle\" and replace all the logic for your own mail engine.\n\n## Credits\n\n* Jeroen Desloovere - [Github](https://github.com/jeroendesloovere), [Website](http://jeroendesloovere.be)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmailmotor%2Fmailmotor-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmailmotor%2Fmailmotor-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmailmotor%2Fmailmotor-bundle/lists"}