{"id":19904932,"url":"https://github.com/mailmotor/campaignmonitor-bundle","last_synced_at":"2025-08-25T22:10:28.938Z","repository":{"id":60774601,"uuid":"47191164","full_name":"mailmotor/campaignmonitor-bundle","owner":"mailmotor","description":"(Un)Subscribing members to your CampaignMonitor Mailinglists very easily using this Symfony Bundle.","archived":false,"fork":false,"pushed_at":"2023-03-13T16:30:56.000Z","size":34,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-01T01:45:44.341Z","etag":null,"topics":["campaign-monitor","campaignmonitor-bundle","cm","mail-engine","mailinglist","php","symfony-bundle"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/mailmotor/campaignmonitor-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-12-01T13:26:59.000Z","updated_at":"2024-05-15T20:33:04.000Z","dependencies_parsed_at":"2024-06-21T05:43:39.845Z","dependency_job_id":"ce002d96-3f23-4163-90f6-089f0ae8ad72","html_url":"https://github.com/mailmotor/campaignmonitor-bundle","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailmotor%2Fcampaignmonitor-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailmotor%2Fcampaignmonitor-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailmotor%2Fcampaignmonitor-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailmotor%2Fcampaignmonitor-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mailmotor","download_url":"https://codeload.github.com/mailmotor/campaignmonitor-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224345950,"owners_count":17296121,"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","campaignmonitor-bundle","cm","mail-engine","mailinglist","php","symfony-bundle"],"created_at":"2024-11-12T20:30:25.694Z","updated_at":"2024-11-12T20:32:23.951Z","avatar_url":"https://github.com/mailmotor.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CampaignMonitorBundle\n\n[![Latest Stable Version](http://img.shields.io/packagist/v/mailmotor/campaignmonitor-bundle.svg)](https://packagist.org/packages/mailmotor/campaignmonitor-bundle)\n[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/mailmotor/campaignmonitor-bundle/blob/master/LICENSE)\n[![Build Status](https://travis-ci.org/mailmotor/campaignmonitor-bundle.svg?branch=new-version)](https://travis-ci.org/mailmotor/campaignmonitor-bundle)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mailmotor/campaignmonitor-bundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mailmotor/campaignmonitor-bundle/?branch=master)\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 (CampaignMonitor)\n\n```bash\ncomposer require mailmotor/campaignmonitor-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\\CampaignMonitorBundle\\MailMotorCampaignMonitorBundle(),\n    );\n```\n\n```yaml\n# In `app/config/parameters.yml`\nparameters:\n    # ...\n    mailmotor.mail_engine:  'campaignmonitor'\n    mailmotor.api_key:      xxx # enter your campaignmonitor api_key here\n    mailmotor.list_id:      xxx # enter the campaignmonitor 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/campaignmonitor-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%2Fcampaignmonitor-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmailmotor%2Fcampaignmonitor-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmailmotor%2Fcampaignmonitor-bundle/lists"}