{"id":15045084,"url":"https://github.com/mailmotor/mailchimp-bundle","last_synced_at":"2026-04-02T02:37:07.032Z","repository":{"id":37547594,"uuid":"46970087","full_name":"mailmotor/mailchimp-bundle","owner":"mailmotor","description":"(Un)Subscribing members to your MailChimp Mailinglists very easily using this Symfony Bundle.","archived":false,"fork":false,"pushed_at":"2023-04-19T21:05:35.000Z","size":128,"stargazers_count":4,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T04:32:06.368Z","etag":null,"topics":["mail-engine","mailchimp","mailchimp-bundle","mailinglist","php","symfony-bundle"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/mailmotor/mailchimp-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-11-27T09:02:26.000Z","updated_at":"2024-10-21T09:34:04.000Z","dependencies_parsed_at":"2024-06-19T20:06:55.824Z","dependency_job_id":"4f16f7d0-a52a-4ec7-8456-d3bf8f5ed541","html_url":"https://github.com/mailmotor/mailchimp-bundle","commit_stats":{"total_commits":84,"total_committers":7,"mean_commits":12.0,"dds":0.3928571428571429,"last_synced_commit":"17e9c50f72e9330afd724a20d267c7e1dc37f65b"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailmotor%2Fmailchimp-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailmotor%2Fmailchimp-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailmotor%2Fmailchimp-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailmotor%2Fmailchimp-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mailmotor","download_url":"https://codeload.github.com/mailmotor/mailchimp-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238053514,"owners_count":19408699,"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-engine","mailchimp","mailchimp-bundle","mailinglist","php","symfony-bundle"],"created_at":"2024-09-24T20:51:26.171Z","updated_at":"2025-10-25T00:31:38.020Z","avatar_url":"https://github.com/mailmotor.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MailChimpBundle\n\n\u003e Subscribing/Unsubscribing to your own mailinglist has never been this easy! Thanks to this Symfony2 bundle.\n\n## Examples\n\n### Configure (MailChimp)\n\n```bash\ncomposer require mailmotor/mailchimp-bundle\n```\n\n```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\nmailmotor.mail_engine:  'mailchimp'\nmailmotor.api_key:      xxx # enter your mailchimp api_key here\nmailmotor.server:       xxx # enter your mailchimp server prefix here (f.e. us1)\nmailmotor.list_id:      xxx # enter the mailchimp default list_id here\n```\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%2Fmailchimp-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmailmotor%2Fmailchimp-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmailmotor%2Fmailchimp-bundle/lists"}