{"action":"closed","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/14831","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/14831/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/14831/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/14831/events","html_url":"https://github.com/laravel/framework/issues/14831","id":171168017,"number":14831,"title":"Mail view has $message, but $message cannot give subject","user":{"login":"afraca","id":244807,"avatar_url":"https://avatars.githubusercontent.com/u/244807?v=3","gravatar_id":"","url":"https://api.github.com/users/afraca","html_url":"https://github.com/afraca","followers_url":"https://api.github.com/users/afraca/followers","following_url":"https://api.github.com/users/afraca/following{/other_user}","gists_url":"https://api.github.com/users/afraca/gists{/gist_id}","starred_url":"https://api.github.com/users/afraca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afraca/subscriptions","organizations_url":"https://api.github.com/users/afraca/orgs","repos_url":"https://api.github.com/users/afraca/repos","events_url":"https://api.github.com/users/afraca/events{/privacy}","received_events_url":"https://api.github.com/users/afraca/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-15T13:17:41Z","updated_at":"2016-09-05T22:54:19Z","closed_at":"2016-09-05T22:54:19Z","body":"If we use \r\n\r\n    Mail::send('templ.blade.php', [], function($message) {\r\n     $message->subject('foo bar baz');\r\n     }\r\n\r\nThe mail template gets a variable $message to use for attachments. One call also call `$message->getSubject()` in the template, but this will always return null. \r\n\r\nI think this has to do with the order that send() uses for the callback and the template processing:\r\n\r\nhttps://github.com/laravel/framework/blob/781719746271098ed5049023921c084392494102/src/Illuminate/Mail/Mailer.php#L163\r\n\r\nThat's rather unfortunate and counter-intuitive. Of course one can use a variable for the subject, and pass it to the view like in other situations, but sometimes you have to do this a lot of times and this gets cumbersome, but more importantly, in theory the subject could depend on the $message."}}
{"actor":{"display_login":"themsaid"}}