# laravel email https://www.youtube.com/watch?v=ZWzH6SOzjhI ## SMS https://www.youtube.com/watch?v=kmRgXqbIjmY&ab_channel=LaravelDaily ## queue 直接就有兩個trait的 一個序列化模型 只要建構式裡面有 model 然後會進到queue就需要 第二個就queue的必備 ## 保留字 message 這是會保留的 可以用來傳圖片之類的 ## 加密被擋(ssl) 重要 Connection could not be established with host smtp.gmail.com :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed 如果問題是本地端不能加密寄信 去用這篇最下面的方法 直接改vender的 反正vender不會上傳 如果上傳就不會遇到不讓加密 https://stackoverflow.com/questions/62646438/laravel-stream-socket-enable-crypto-ssl-operation-failed-with-code-1 ## message message變量總是傳遞到電子郵件的意見,並允許內嵌嵌入附件。因此,您應該避免message在視圖負載中傳遞變量。 例如圖片 $message->embed() 有很多 看官網 ## 自定義 Laravel Auth 默認電子郵件 複寫 消息通知 跟trait觸發 notintion的那個 new function https://www.youtube.com/watch?v=c01k5Zo_CuI ## 變數  public就能直接傳到view了 ## 電子郵件測試到 laravel.log 您想在您的應用程序中測試電子郵件內容,但無法或不願意設置類似 Mailgun 的內容,請使用.env參數MAIL_DRIVER=log,所有電子郵件將保存到storage/logs/laravel.log文件中,而不是實際發送 就改env就能在log看 但是這樣不方便所以要安裝 telescpoe 那個debug套件 然就打開看就能了  影片在下面 https://laracasts.com/series/laravel-from-scratch-2018/episodes/28 ## 向任何人發送通知 您不僅可以通過 將 Laravel 通知發送給特定用戶$user->notify(),還可以通過Notification::route()所謂的“按需”通知發送給您想要的任何人: ``` Notification::route('mail', 'taylor@example.com') ->route('nexmo', '5555555555') ->route('slack', 'https://hooks.slack.com/services/...') ->notify(new InvoicePaid($invoice)); ``` ## reset password 跟登入驗證eamil 這是兩個都是trait所以也能在controller用 https://www.youtube.com/watch?v=6mN0Oj6xR30 第二跟第三點會講到 詳細要看文黨 ## Markdown https://www.bilibili.com/video/BV1f54y197ba/?spm_id_from=333.788.videocard.0 不可縮進 全部貼底 @compnent(Mail::message) 這些component在哪 vender底下的 email 也可以直接 php artisna render:push --tag=laravel-mail 推到上面來 直接改  email最上面的在哪  這個是看env裡面的 APP_NAME 你也可以去config改 這個tag是指樣式 看help 裡面第一行 跟tag說明  自訂義樣式  就只是把Vender的引入到resoruce裡面  但其實不好改直接css 最好複製一個 然後去config改 theme(主題) 對我們的css  theme的value對應文件名稱 ## 第三方寄信 https://laraveldaily.com/how-to-send-email-from-laravel-and-why-we-need-3rd-party-providers-for-it/ 這好處是 第三方 就比較不會被當成垃圾擋住 因為他們有良好的信譽 ## 三種寄信方法 https://www.youtube.com/watch?v=ZWzH6SOzjhI 最好的是用event 原因可以去看enevt那邊 ## 驗證 實現inerface原因 註冊的trait裡面的listent有判斷  然後路由記得true 自己看官方文件 ###### tags: `Laravel`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up