{"action":"created","comment":{"url":"https://api.github.com/repos/Sylius/Sylius/pulls/comments/24001233","id":24001233,"diff_hunk":"@@ -246,4 +244,20 @@ sylius_translation:\n             fallbackLocale: fallbackLocale\n         translation:\n             field: translatable\n-            locale: locale\n\\ No newline at end of file\n+            locale: locale\n+\n+sylius_mailer:","path":"src/Sylius/Bundle/CoreBundle/Resources/config/app/sylius.yml","position":16,"original_position":16,"commit_id":"9b60ad0aa3eedb4ba03d53306b5f8daeeaa8d5e0","original_commit_id":"9b60ad0aa3eedb4ba03d53306b5f8daeeaa8d5e0","user":{"login":"amenophis","id":2158235,"avatar_url":"https://avatars.githubusercontent.com/u/2158235?v=3","gravatar_id":"","url":"https://api.github.com/users/amenophis","html_url":"https://github.com/amenophis","followers_url":"https://api.github.com/users/amenophis/followers","following_url":"https://api.github.com/users/amenophis/following{/other_user}","gists_url":"https://api.github.com/users/amenophis/gists{/gist_id}","starred_url":"https://api.github.com/users/amenophis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amenophis/subscriptions","organizations_url":"https://api.github.com/users/amenophis/orgs","repos_url":"https://api.github.com/users/amenophis/repos","events_url":"https://api.github.com/users/amenophis/events{/privacy}","received_events_url":"https://api.github.com/users/amenophis/received_events","type":"User","site_admin":false},"body":"OK ;)","created_at":"2015-02-03T12:54:26Z","updated_at":"2015-02-03T12:54:26Z","html_url":"https://github.com/Sylius/Sylius/pull/2406#discussion_r24001233","pull_request_url":"https://api.github.com/repos/Sylius/Sylius/pulls/2406","_links":{"self":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/comments/24001233"},"html":{"href":"https://github.com/Sylius/Sylius/pull/2406#discussion_r24001233"},"pull_request":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/2406"}}},"pull_request":{"url":"https://api.github.com/repos/Sylius/Sylius/pulls/2406","id":28302994,"html_url":"https://github.com/Sylius/Sylius/pull/2406","diff_url":"https://github.com/Sylius/Sylius/pull/2406.diff","patch_url":"https://github.com/Sylius/Sylius/pull/2406.patch","issue_url":"https://api.github.com/repos/Sylius/Sylius/issues/2406","number":2406,"state":"open","locked":false,"title":"Simpler configurable emails","user":{"login":"pjedrzejewski","id":614970,"avatar_url":"https://avatars.githubusercontent.com/u/614970?v=3","gravatar_id":"","url":"https://api.github.com/users/pjedrzejewski","html_url":"https://github.com/pjedrzejewski","followers_url":"https://api.github.com/users/pjedrzejewski/followers","following_url":"https://api.github.com/users/pjedrzejewski/following{/other_user}","gists_url":"https://api.github.com/users/pjedrzejewski/gists{/gist_id}","starred_url":"https://api.github.com/users/pjedrzejewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjedrzejewski/subscriptions","organizations_url":"https://api.github.com/users/pjedrzejewski/orgs","repos_url":"https://api.github.com/users/pjedrzejewski/repos","events_url":"https://api.github.com/users/pjedrzejewski/events{/privacy}","received_events_url":"https://api.github.com/users/pjedrzejewski/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | yes\r\n| Deprecations? | no\r\n| Fixed tickets | -\r\n| License       | MIT\r\n| Doc PR        | -\r\n\r\nHey folks!\r\n\r\nThis PR does few things:\r\n\r\n1. Makes configuring existing emails so much simpler.\r\n2. Adding new emails is even simpler now.\r\n3. Emails can be configured in the backend (database) and via email.\r\n4. You can send emails via different adapters, we use TwigSwiftmailerAdapter, but you can implement your own and delegate everything to external service/api.\r\n\r\nIt has some BC breaks, so I am open to discuss when it should be merged.\r\n\r\nThings to fix:\r\n\r\n* [ ] I am sick, so maybe I miss something, but can't get the configuration definition right. (thus the hacks with [1] [0]\r\n* [ ] Add global email settings (and settings provider), which allows to configure default sender name and email via backend UI.\r\n\r\nUsage:\r\n\r\n``` yaml\r\nsylius_mailer:\r\n    sender:\r\n        name: My store\r\n        address: no-reply@mystore.com\r\n    templates:\r\n        ::bar.html.twig\r\n        ::foo.html.twig\r\n    emails:\r\n        foo_email:\r\n            subject: Hello Foo!\r\n            template: foo.html.twig\r\n            enabled: false\r\n```\r\n\r\nThat would be it. Let me know what do you think. :)\r\n\r\nTo send the foo_email, you just need to call:\r\n\r\n``` php\r\n$this->get('sylius.email_sender')->send('foo_email', array('recipient@example.com'), array('data' => 'bar'));\r\n```\r\n\r\nIt tries to find the email in DB, then fallbacks to the yaml config. Also, it won't send if it is disabled.","created_at":"2015-01-29T18:35:23Z","updated_at":"2015-02-03T12:54:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5918373b86729266cebc8f2b55bfb6f845a22f75","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Sylius/Sylius/pulls/2406/commits","review_comments_url":"https://api.github.com/repos/Sylius/Sylius/pulls/2406/comments","review_comment_url":"https://api.github.com/repos/Sylius/Sylius/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Sylius/Sylius/issues/2406/comments","statuses_url":"https://api.github.com/repos/Sylius/Sylius/statuses/9b60ad0aa3eedb4ba03d53306b5f8daeeaa8d5e0","head":{"label":"pjedrzejewski:mailer-bundle","ref":"mailer-bundle","sha":"9b60ad0aa3eedb4ba03d53306b5f8daeeaa8d5e0","user":{"login":"pjedrzejewski","id":614970,"avatar_url":"https://avatars.githubusercontent.com/u/614970?v=3","gravatar_id":"","url":"https://api.github.com/users/pjedrzejewski","html_url":"https://github.com/pjedrzejewski","followers_url":"https://api.github.com/users/pjedrzejewski/followers","following_url":"https://api.github.com/users/pjedrzejewski/following{/other_user}","gists_url":"https://api.github.com/users/pjedrzejewski/gists{/gist_id}","starred_url":"https://api.github.com/users/pjedrzejewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjedrzejewski/subscriptions","organizations_url":"https://api.github.com/users/pjedrzejewski/orgs","repos_url":"https://api.github.com/users/pjedrzejewski/repos","events_url":"https://api.github.com/users/pjedrzejewski/events{/privacy}","received_events_url":"https://api.github.com/users/pjedrzejewski/received_events","type":"User","site_admin":false},"repo":{"id":14465495,"name":"Sylius","full_name":"pjedrzejewski/Sylius","owner":{"login":"pjedrzejewski","id":614970,"avatar_url":"https://avatars.githubusercontent.com/u/614970?v=3","gravatar_id":"","url":"https://api.github.com/users/pjedrzejewski","html_url":"https://github.com/pjedrzejewski","followers_url":"https://api.github.com/users/pjedrzejewski/followers","following_url":"https://api.github.com/users/pjedrzejewski/following{/other_user}","gists_url":"https://api.github.com/users/pjedrzejewski/gists{/gist_id}","starred_url":"https://api.github.com/users/pjedrzejewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjedrzejewski/subscriptions","organizations_url":"https://api.github.com/users/pjedrzejewski/orgs","repos_url":"https://api.github.com/users/pjedrzejewski/repos","events_url":"https://api.github.com/users/pjedrzejewski/events{/privacy}","received_events_url":"https://api.github.com/users/pjedrzejewski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pjedrzejewski/Sylius","description":"Modern e-commerce for PHP, based on the Symfony2 framework.","fork":true,"url":"https://api.github.com/repos/pjedrzejewski/Sylius","forks_url":"https://api.github.com/repos/pjedrzejewski/Sylius/forks","keys_url":"https://api.github.com/repos/pjedrzejewski/Sylius/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pjedrzejewski/Sylius/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pjedrzejewski/Sylius/teams","hooks_url":"https://api.github.com/repos/pjedrzejewski/Sylius/hooks","issue_events_url":"https://api.github.com/repos/pjedrzejewski/Sylius/issues/events{/number}","events_url":"https://api.github.com/repos/pjedrzejewski/Sylius/events","assignees_url":"https://api.github.com/repos/pjedrzejewski/Sylius/assignees{/user}","branches_url":"https://api.github.com/repos/pjedrzejewski/Sylius/branches{/branch}","tags_url":"https://api.github.com/repos/pjedrzejewski/Sylius/tags","blobs_url":"https://api.github.com/repos/pjedrzejewski/Sylius/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pjedrzejewski/Sylius/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pjedrzejewski/Sylius/git/refs{/sha}","trees_url":"https://api.github.com/repos/pjedrzejewski/Sylius/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pjedrzejewski/Sylius/statuses/{sha}","languages_url":"https://api.github.com/repos/pjedrzejewski/Sylius/languages","stargazers_url":"https://api.github.com/repos/pjedrzejewski/Sylius/stargazers","contributors_url":"https://api.github.com/repos/pjedrzejewski/Sylius/contributors","subscribers_url":"https://api.github.com/repos/pjedrzejewski/Sylius/subscribers","subscription_url":"https://api.github.com/repos/pjedrzejewski/Sylius/subscription","commits_url":"https://api.github.com/repos/pjedrzejewski/Sylius/commits{/sha}","git_commits_url":"https://api.github.com/repos/pjedrzejewski/Sylius/git/commits{/sha}","comments_url":"https://api.github.com/repos/pjedrzejewski/Sylius/comments{/number}","issue_comment_url":"https://api.github.com/repos/pjedrzejewski/Sylius/issues/comments/{number}","contents_url":"https://api.github.com/repos/pjedrzejewski/Sylius/contents/{+path}","compare_url":"https://api.github.com/repos/pjedrzejewski/Sylius/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pjedrzejewski/Sylius/merges","archive_url":"https://api.github.com/repos/pjedrzejewski/Sylius/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pjedrzejewski/Sylius/downloads","issues_url":"https://api.github.com/repos/pjedrzejewski/Sylius/issues{/number}","pulls_url":"https://api.github.com/repos/pjedrzejewski/Sylius/pulls{/number}","milestones_url":"https://api.github.com/repos/pjedrzejewski/Sylius/milestones{/number}","notifications_url":"https://api.github.com/repos/pjedrzejewski/Sylius/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pjedrzejewski/Sylius/labels{/name}","releases_url":"https://api.github.com/repos/pjedrzejewski/Sylius/releases{/id}","created_at":"2013-11-17T11:15:26Z","updated_at":"2015-01-29T09:23:59Z","pushed_at":"2015-01-30T11:31:08Z","git_url":"git://github.com/pjedrzejewski/Sylius.git","ssh_url":"git@github.com:pjedrzejewski/Sylius.git","clone_url":"https://github.com/pjedrzejewski/Sylius.git","svn_url":"https://github.com/pjedrzejewski/Sylius","homepage":"Sylius.org","size":17281,"stargazers_count":6,"watchers_count":6,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":6,"default_branch":"master"}},"base":{"label":"Sylius:master","ref":"master","sha":"4ef441dac5b7f314e59586cf15f06024cfc38494","user":{"login":"Sylius","id":719423,"avatar_url":"https://avatars.githubusercontent.com/u/719423?v=3","gravatar_id":"","url":"https://api.github.com/users/Sylius","html_url":"https://github.com/Sylius","followers_url":"https://api.github.com/users/Sylius/followers","following_url":"https://api.github.com/users/Sylius/following{/other_user}","gists_url":"https://api.github.com/users/Sylius/gists{/gist_id}","starred_url":"https://api.github.com/users/Sylius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sylius/subscriptions","organizations_url":"https://api.github.com/users/Sylius/orgs","repos_url":"https://api.github.com/users/Sylius/repos","events_url":"https://api.github.com/users/Sylius/events{/privacy}","received_events_url":"https://api.github.com/users/Sylius/received_events","type":"Organization","site_admin":false},"repo":{"id":2717549,"name":"Sylius","full_name":"Sylius/Sylius","owner":{"login":"Sylius","id":719423,"avatar_url":"https://avatars.githubusercontent.com/u/719423?v=3","gravatar_id":"","url":"https://api.github.com/users/Sylius","html_url":"https://github.com/Sylius","followers_url":"https://api.github.com/users/Sylius/followers","following_url":"https://api.github.com/users/Sylius/following{/other_user}","gists_url":"https://api.github.com/users/Sylius/gists{/gist_id}","starred_url":"https://api.github.com/users/Sylius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sylius/subscriptions","organizations_url":"https://api.github.com/users/Sylius/orgs","repos_url":"https://api.github.com/users/Sylius/repos","events_url":"https://api.github.com/users/Sylius/events{/privacy}","received_events_url":"https://api.github.com/users/Sylius/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Sylius/Sylius","description":"Modern e-commerce for PHP, based on the Symfony2 framework.","fork":false,"url":"https://api.github.com/repos/Sylius/Sylius","forks_url":"https://api.github.com/repos/Sylius/Sylius/forks","keys_url":"https://api.github.com/repos/Sylius/Sylius/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sylius/Sylius/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sylius/Sylius/teams","hooks_url":"https://api.github.com/repos/Sylius/Sylius/hooks","issue_events_url":"https://api.github.com/repos/Sylius/Sylius/issues/events{/number}","events_url":"https://api.github.com/repos/Sylius/Sylius/events","assignees_url":"https://api.github.com/repos/Sylius/Sylius/assignees{/user}","branches_url":"https://api.github.com/repos/Sylius/Sylius/branches{/branch}","tags_url":"https://api.github.com/repos/Sylius/Sylius/tags","blobs_url":"https://api.github.com/repos/Sylius/Sylius/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sylius/Sylius/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sylius/Sylius/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sylius/Sylius/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sylius/Sylius/statuses/{sha}","languages_url":"https://api.github.com/repos/Sylius/Sylius/languages","stargazers_url":"https://api.github.com/repos/Sylius/Sylius/stargazers","contributors_url":"https://api.github.com/repos/Sylius/Sylius/contributors","subscribers_url":"https://api.github.com/repos/Sylius/Sylius/subscribers","subscription_url":"https://api.github.com/repos/Sylius/Sylius/subscription","commits_url":"https://api.github.com/repos/Sylius/Sylius/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sylius/Sylius/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sylius/Sylius/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sylius/Sylius/issues/comments/{number}","contents_url":"https://api.github.com/repos/Sylius/Sylius/contents/{+path}","compare_url":"https://api.github.com/repos/Sylius/Sylius/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sylius/Sylius/merges","archive_url":"https://api.github.com/repos/Sylius/Sylius/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sylius/Sylius/downloads","issues_url":"https://api.github.com/repos/Sylius/Sylius/issues{/number}","pulls_url":"https://api.github.com/repos/Sylius/Sylius/pulls{/number}","milestones_url":"https://api.github.com/repos/Sylius/Sylius/milestones{/number}","notifications_url":"https://api.github.com/repos/Sylius/Sylius/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sylius/Sylius/labels{/name}","releases_url":"https://api.github.com/repos/Sylius/Sylius/releases{/id}","created_at":"2011-11-05T22:05:52Z","updated_at":"2015-02-03T11:38:46Z","pushed_at":"2015-02-03T11:38:46Z","git_url":"git://github.com/Sylius/Sylius.git","ssh_url":"git@github.com:Sylius/Sylius.git","clone_url":"https://github.com/Sylius/Sylius.git","svn_url":"https://github.com/Sylius/Sylius","homepage":"Sylius.org","size":41095,"stargazers_count":1577,"watchers_count":1577,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":532,"mirror_url":null,"open_issues_count":380,"forks":532,"open_issues":380,"watchers":1577,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/2406"},"html":{"href":"https://github.com/Sylius/Sylius/pull/2406"},"issue":{"href":"https://api.github.com/repos/Sylius/Sylius/issues/2406"},"comments":{"href":"https://api.github.com/repos/Sylius/Sylius/issues/2406/comments"},"review_comments":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/2406/comments"},"review_comment":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/2406/commits"},"statuses":{"href":"https://api.github.com/repos/Sylius/Sylius/statuses/9b60ad0aa3eedb4ba03d53306b5f8daeeaa8d5e0"}}}}