{"action":"created","issue":{"url":"https://api.github.com/repos/civicrm/org.civicrm.flexmailer/issues/7","repository_url":"https://api.github.com/repos/civicrm/org.civicrm.flexmailer","labels_url":"https://api.github.com/repos/civicrm/org.civicrm.flexmailer/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/civicrm/org.civicrm.flexmailer/issues/7/comments","events_url":"https://api.github.com/repos/civicrm/org.civicrm.flexmailer/issues/7/events","html_url":"https://github.com/civicrm/org.civicrm.flexmailer/pull/7","id":272393814,"number":7,"title":"Convert from `civi.flexmailer.*` to `hook_civicrm_*` (#1)","user":{"login":"totten","id":1336047,"avatar_url":"https://avatars0.githubusercontent.com/u/1336047?v=4","gravatar_id":"","url":"https://api.github.com/users/totten","html_url":"https://github.com/totten","followers_url":"https://api.github.com/users/totten/followers","following_url":"https://api.github.com/users/totten/following{/other_user}","gists_url":"https://api.github.com/users/totten/gists{/gist_id}","starred_url":"https://api.github.com/users/totten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/totten/subscriptions","organizations_url":"https://api.github.com/users/totten/orgs","repos_url":"https://api.github.com/users/totten/repos","events_url":"https://api.github.com/users/totten/events{/privacy}","received_events_url":"https://api.github.com/users/totten/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-09T00:00:57Z","updated_at":"2017-11-09T00:06:43Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/civicrm/org.civicrm.flexmailer/pulls/7","html_url":"https://github.com/civicrm/org.civicrm.flexmailer/pull/7","diff_url":"https://github.com/civicrm/org.civicrm.flexmailer/pull/7.diff","patch_url":"https://github.com/civicrm/org.civicrm.flexmailer/pull/7.patch"},"body":"(Pinging a few folks who've expressed interest in either Symfony Events or customizing the email delivery engine: @michaelmcandrew @tttp @nganivet @GinkgoFJG @mattwire @seanmadsen @seamuslee001.)\r\n\r\nAs discussed later in #1, `civicrm-core` has now [unified](https://github.com/civicrm/civicrm-core/pull/9949) the concepts of \"hooks\" and \"Symfony events\". Thus, the FlexMailer events could be presented as \"hooks\" while still supporting the more advanced features we need from Symfony  (such as `debug:event-dispatcher`, priorities, and `stopPropagation()`).\r\n\r\nThis PR renames the events from `civi.flexmailer.*` to `hook_civicrm_*` and thus makes it superficially work as a \"hook\". I did a cursory test to confirm that the hook fires and gives full access to the event, along the lines of:\r\n\r\n```php\r\nfunction mymodule_civicrm_flexmailer_compose(ComposeBatchEvent $event) { ... } \r\n```\r\n\r\nSo this is nice in that brings some harmony to the design.\r\n\r\nHowever, I also feel that it's a bit misleading: FlexMailer is designed with the *expectation* that you'll do things like setting the priority of events (ie intentionally scheduling listener A before listener B). The process of delegating hooks to all the CMS's is reductive (it obfuscates these things), so I felt obliged to warn against it in the docs (below).\r\n\r\nWhich begs the question: if it's a bad idea to use CMS hook notation with these events, should we really support it?\r\n\r\nComments appreciated. If you'd just like to weigh-in with a quick gut reaction, feel free to do an emoji like:\r\n * ❤️ I love the word \"hook\"! Make the change to `hook_civicrm_flexmailer_*`.\r\n * 😕 I'm confused by features that you're not supposed to use. Keep `civi.flexmailer.*`.\r\n\r\nI'm aiming to resolve the PR (accept it or reject it) by the end of the week (US/Pacific; ~48 hours)."},"comment":{"url":"https://api.github.com/repos/civicrm/org.civicrm.flexmailer/issues/comments/343003708","html_url":"https://github.com/civicrm/org.civicrm.flexmailer/pull/7#issuecomment-343003708","issue_url":"https://api.github.com/repos/civicrm/org.civicrm.flexmailer/issues/7","id":343003708,"user":{"login":"seamuslee001","id":6799125,"avatar_url":"https://avatars2.githubusercontent.com/u/6799125?v=4","gravatar_id":"","url":"https://api.github.com/users/seamuslee001","html_url":"https://github.com/seamuslee001","followers_url":"https://api.github.com/users/seamuslee001/followers","following_url":"https://api.github.com/users/seamuslee001/following{/other_user}","gists_url":"https://api.github.com/users/seamuslee001/gists{/gist_id}","starred_url":"https://api.github.com/users/seamuslee001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seamuslee001/subscriptions","organizations_url":"https://api.github.com/users/seamuslee001/orgs","repos_url":"https://api.github.com/users/seamuslee001/repos","events_url":"https://api.github.com/users/seamuslee001/events{/privacy}","received_events_url":"https://api.github.com/users/seamuslee001/received_events","type":"User","site_admin":false},"created_at":"2017-11-09T00:06:43Z","updated_at":"2017-11-09T00:06:43Z","author_association":"NONE","body":"I prefer the hook style because to me then things are at least somewhat consistent across the software in that you use hooks to alter things. Yes its probably strange having symphony events outputted as hooks but i think its sensible here"}}
{"actor":{"display_login":"seamuslee001"}}