Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Laravel with SendGrid

Laravel with SendGrid

Laravel勉強会 2016/6/17 発表資料

s-ichikawa

June 16, 2016
Tweet

More Decks by s-ichikawa

Other Decks in Programming

Transcript

  1. What is SendGrid ▸ ϝʔϧ഑৴Λߦ͏ͨΊͷΫϥ΢υαʔϏε ▸ ΞΧ΢ϯτൃߦ͢Ε͹͙͢ʹSMTP઀ଓɺWeb(REST) APIɺϚʔέ ςΟϯάϝʔϧػೳΛ࢖ͬͯϝʔϧΛૹ৴Ͱ͖Δ ▸

    ແྉ࿮͕͋Δ(ແྉͰ400௨/೔) ▸ SMTP APIͱ͍͏ػೳ͕ศར ▸ ։෧΍ΫϦοΫͷΠϕϯτΛHookͰ͖Δ ▸ ؅ཧը໘͔Β༷ʑͳ౷ܭ৘ใ͕ࢀরՄೳ About
  2. <?php return array( 'driver' => 'smtp', 'host' => 'smtp.sendgrid.net', 'port'

    => 587, 'from' => array('address' => '[email protected]', 'name' => 'John Smith'), 'encryption' => 'tls', 'username' => 'sendgrid_username', 'password' => 'sendgrid_password', ); config/mail.php In Laravel SendGridͷSMTPαʔόΛ࢖͏
  3. ެࣜϥΠϒϥϦΛ࢖ͬͯΈΔ ▸ sendgrid/sendgrid-php ΛcomposerͳͲͰΠϯετʔϧ͢ Δ ▸ $sendgrid = new SendGrid('YOUR_SENDGRID_APIKEY');

    ▸ $email = new SendGrid\Email(); ▸ $email->addTo('[email protected]'); // ͱ͔৭ʑઃఆ͢Δ ▸ $sendgrid->send($email); In Laravel