{"action":"created","issue":{"url":"https://api.github.com/repos/php-cds/php-cds/issues/15","repository_url":"https://api.github.com/repos/php-cds/php-cds","labels_url":"https://api.github.com/repos/php-cds/php-cds/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/php-cds/php-cds/issues/15/comments","events_url":"https://api.github.com/repos/php-cds/php-cds/issues/15/events","html_url":"https://github.com/php-cds/php-cds/issues/15","id":154562826,"number":15,"title":"[RFC] Standard email sending interface","user":{"login":"Petah","id":134799,"avatar_url":"https://avatars.githubusercontent.com/u/134799?v=3","gravatar_id":"","url":"https://api.github.com/users/Petah","html_url":"https://github.com/Petah","followers_url":"https://api.github.com/users/Petah/followers","following_url":"https://api.github.com/users/Petah/following{/other_user}","gists_url":"https://api.github.com/users/Petah/gists{/gist_id}","starred_url":"https://api.github.com/users/Petah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Petah/subscriptions","organizations_url":"https://api.github.com/users/Petah/orgs","repos_url":"https://api.github.com/users/Petah/repos","events_url":"https://api.github.com/users/Petah/events{/privacy}","received_events_url":"https://api.github.com/users/Petah/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/php-cds/php-cds/labels/[RFC]","name":"[RFC]","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":31,"created_at":"2016-05-12T19:32:49Z","updated_at":"2016-06-01T09:33:24Z","closed_at":null,"body":"I propose a standard email sending interface. I has always bothered me that every framework/ecommerce platform handles email differently.\r\n\r\nConsider this a draft, I will come back later and flesh it out some more. \r\n\r\n```\r\ninterface EmailInterface {\r\n    public function addTo(string $emailAddress, string $name = null);\r\n    public function addFrom(string $emailAddress, string $name = null);\r\n    public function addCc(string $emailAddress, string $name = null);\r\n    public function addBcc(string $emailAddress, string $name = null);\r\n    public function addReplyTo(string $emailAddress, string $name = null);\r\n    public function setSender(string $emailAddress, string $name = null);\r\n    public function addHeader(string $key, string $value);\r\n    public function setSubject(string $subject);\r\n    public function addAttachment($file);\r\n    public function setText(string $text);\r\n    public function setHtml(string $html);\r\n}\r\n\r\ninterface EmailSenderInterface {\r\n    public function send(EmailInterface $email);\r\n}\r\n```\r\n\r\nThings to also consider is adding `remove*` methods, and other features like priority, inline attachments, return path etc."},"comment":{"url":"https://api.github.com/repos/php-cds/php-cds/issues/comments/222941616","html_url":"https://github.com/php-cds/php-cds/issues/15#issuecomment-222941616","issue_url":"https://api.github.com/repos/php-cds/php-cds/issues/15","id":222941616,"user":{"login":"mathroc","id":291531,"avatar_url":"https://avatars.githubusercontent.com/u/291531?v=3","gravatar_id":"","url":"https://api.github.com/users/mathroc","html_url":"https://github.com/mathroc","followers_url":"https://api.github.com/users/mathroc/followers","following_url":"https://api.github.com/users/mathroc/following{/other_user}","gists_url":"https://api.github.com/users/mathroc/gists{/gist_id}","starred_url":"https://api.github.com/users/mathroc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathroc/subscriptions","organizations_url":"https://api.github.com/users/mathroc/orgs","repos_url":"https://api.github.com/users/mathroc/repos","events_url":"https://api.github.com/users/mathroc/events{/privacy}","received_events_url":"https://api.github.com/users/mathroc/received_events","type":"User","site_admin":false},"created_at":"2016-06-01T09:33:24Z","updated_at":"2016-06-01T09:33:24Z","body":"> @sagikazarmark My proposal is not against having the withProperty-like methods in the Email interface, my proposal is against forcing programmers to use them at construction time. Having a separate builder interface does not harm the main proposal idea of having immutable \"value objects\".\r\n\r\nit does make the interface more complex and thus harder/longer to implement and more prone to bugs (both in the interface and in the implementations)\r\n\r\n> In addition, the performance impact of relying on clone operations is easily measurable and not negligible. \r\n\r\ncan we see some data ? I'm believe there is a performance impact on using valueobject (but I'm not even sure) and I'm not sure at all the impact is \"not negligible\"\r\n\r\nanyway, the builder interface could also be provided outside of this RFC, either as a standalone library or another RFC"}}
{"actor":{"display_login":"mathroc"}}