Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SendGrid Template Engine 奮闘記
Search
Shogo Kawahara
March 28, 2017
Programming
0
300
SendGrid Template Engine 奮闘記
SendGrid Night #7 でのLT資料です
https://eventdots.jp/event/615303
Shogo Kawahara
March 28, 2017
Tweet
Share
More Decks by Shogo Kawahara
See All by Shogo Kawahara
データベースだけじゃないN+1とその対策
kawahara
0
640
CoderDojo 千葉県総武線沿線の取り組み
kawahara
1
350
Other Decks in Programming
See All in Programming
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
330
受け取る人から提供する人になるということ
little_rubyist
0
230
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
C++でシェーダを書く
fadis
6
4.1k
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.5k
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
610
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.4k
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
Contemporary Test Cases
maaretp
0
130
Featured
See All Featured
Fireside Chat
paigeccino
34
3k
Music & Morning Musume
bryan
46
6.2k
We Have a Design System, Now What?
morganepeng
50
7.2k
A Tale of Four Properties
chriscoyier
156
23k
Adopting Sorbet at Scale
ufuk
73
9.1k
Building an army of robots
kneath
302
43k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Faster Mobile Websites
deanohume
305
30k
Documentation Writing (for coders)
carmenintech
65
4.4k
How GitHub (no longer) Works
holman
310
140k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Transcript
4FOE(SJE5FNQMBUF &OHJOFฃಆه 4IPHP,BXBIBSBTIPHPLBXBIBSB!DPEFBMBTJB 4FOE(SJE/JHIUWPM
ݪͰ͢ w ίσΞϧגࣜձࣾ$50 w LBXBIBSB w PPIBSBCVDZPV w 3VCZ 3VCZPO3BJMTͱ
Ұॹʹ4FOE(SJE׆༻த
4FOE(SJEઈࢍ׆༻த ϦϞʔτՄͷ෭ۀϑϦʔϥϯε Ҋ݅Λܝࡌͨ͠ ϫʔΩϯάϦΫϧʔςΟϯάαʔϏε IUUQTXXXDPEFBMXPSL Ԡืϝοηʔδͷར༻ͳͲ ٻ৬ऀ༷࠾༻୲ऀ༷ ϝʔϧૹ৴ "1*W #PVODF#MPDLใͳͲ
$VTUPNFS4VQQPSU 5FBN .BSLFUJOH&NBJM ʹΑΔϝϧϚΨͷൃߦӦۀ
4FOE(SJE5FNQMBUF&OHJOFͬͯ·͢ 4FOE(SJE5FNQMBUF&OHJOFJT"XFTPNF
4FOE(SJE5FNQMBUF&OHJOF ͬͯ·͍ͨͭ͠࠷ۙ·Ͱ #VU XFEPO`UVTFJUBOZNPSF8IZ
4FOE(SJE5FNQMBUF&OHJOF ͱ BMXPSL Ԡืϝοηʔδͷར༻ͳͲ ٻ৬ऀ༷࠾༻୲ऀ༷ ϝʔϧૹ৴ "1*W #PVODF#MPDLใͳͲ $VTUPNFS4VQQPSU 5FBN
.BSLFUJOH&NBJM -FHBDZ ʹΑΔϝϧϚΨͷൃߦӦۀ ֤छϝʔϧͷςϯϓϨʔτͷཧ .BOBHJOH5FNQMBUF&OHJOF ͷߏ
ར༻͢ΔϝϦοτ w ϝʔϧςϯϓϨʔτػೳΛ4FOE(SJEଆ͕ఏڙͯ͠ ͘ΕΔ w ΩϟϯϖʔϯใͳͲΛ$VTUPNFS4VQQPSU 5FBN͕։ൃνʔϜͷखΛΘͣʹૠೖ͢Δ͜ͱ ͕Ͱ͖Δ
4FOE(SJE5FNQMBUF&OHJOF ؆୯ͳ͍ํ ςϯϓϨʔτΛ࡞͠·͢
4FOE(SJE5FNQMBUF&OHJOF ؆୯ͳ͍ํ όʔδϣϯΛ࡞͠·͢
4FOE(SJE5FNQMBUF&OHJOF ؆୯ͳ͍ํ
4FOE(SJE5FNQMBUF&OHJOF ؆୯ͳ͍ํ
w (FNTͷՃ w TFOEHSJESVCZ σϞͰWܥΛར༻ w W࣌ʹൺੲʹ͘Β͍ͯ͘͢ͳ͍ͬͯ Δؾ͕͠·͢Α TFOEHSJESVCZWJT
CFUUFSUIBOPMEPOF 4FOE(SJE5FNQMBUF&OHJOF ؆୯ͳ͍ํ XJUI3VCZ4%,
4FOE(SJE5FNQMBUF&OHJOF ؆୯ͳ͍ํ XJUI3VCZ4%, require 'sendgrid-ruby' personalization = SendGrid::Personalization.new personalization.to =
SendGrid::Email.new(email: '
[email protected]
') personalization.substitutions = SendGrid::Substitution.new(key: '-username-', value: 'ݪ') mail = SendGrid::Mail.new mail.from = SendGrid::Email.new(email: '
[email protected]
') mail.personalizations = personalization mail.template_id = '9c4878c0-0f94-4f8d-ae6b-2b86b499a1aa' sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY']) response = sg.client.mail._('send').post(request_body: mail.to_json)
%&.05*.& w ޭͨ͠Βഥखͱ͔͍ͩ͘͞
ͬͯΘ͔ͬͨσϝϦοτ ɾҙͳͲ w TVCTUJUVUJPOUBHT w )5.-&TDBQFΛߦͬͯ͘Εͳ͍ɻIUNMUFYUڞ௨ Ͱར༻͞ΕΔͷͰɺͱΓ͋͑ͣΤεέʔϓ͖͢จ ࣈΛল͘ॲཧΛߦͬͨ w ςϯϓϨʔτػೳͷͰͳ͍͚Ͳɻɻɻ
w IUUQTTFOEHSJEDPNEPDT"1*@3FGFSFODF 4.51@"1*TVCTUJUVUJPO@UBHTIUNM
ͬͯΘ͔ͬͨσϝϦοτ ɾҙͳͲ w ςϯϓϨʔτ͕૿͑Δͱཧͮ͠Β͍αʔϏε ։࢝ॳظݸҎԼ࠷ۙݸҎ্ w λάͱ͔Ͱݕࡧ͕͋ͬͨΒΑ͔ͬͨͳ͊ w $VTUPNFS4VQQPSUνʔϜ͕ςϯϓϨʔτཧ ͖͠Εͳ͘ͳͬͯ͠·ͬͨɻ
ͬͯΘ͔ͬͨσϝϦοτ ɾҙͳͲ w ຊ൪εςʔδϯάڥͳͲɺෳڥͰͷςϯ ϓϨʔτཧ͕Ͱ͖ͳ͍ υΩϡϝϯτݟΔݶΓ BDUJWFͳͷ͕ૹΒΕͯ͠·͏ εςʔδϯάς ετͱ͔Ͳ͏͢ΔͶʔΜ$4νʔϜ͕͜͜ͰΑ͘ ࣄނͬͨɻ
ͬͯΘ͔ͬͨσϝϦοτ ɾҙͳͲ w ຊ൪εςʔδϯάڥͳͲɺෳڥͰͷςϯ ϓϨʔτཧ͕Ͱ͖ͳ͍ υΩϡϝϯτݟΔݶΓ BDUJWFͳͷ͕ૹΒΕͯ͠·͏ εςʔδϯάς ετͱ͔Ͳ͏͢ΔͶʔΜ$4νʔϜ͕͜͜ͰΑ͘ ࣄނͬͨɻ
αϙʔτᐌ͘ ʮ4VC6TFS͚ͬͯΔ͖ʯ ͱͷ͜ͱͰͨ͠
࠷ऴతʹ w ྲྀੴʹऩू͔ͭͳ͘ͳ͖ͬͯͨ w ڞ௨෦ݸผ෦ͳͲͷϢʔεέʔεΛੳͯ͠ɺͪΌΜ ͱࣗͨͪͷۀʹ߹͏ςϯϓϨʔτΤϯδϯ࡞Γ·ͨ͠
4FOE(SJE5FNQMBUF&NBJM ͜Μͳ࣌ʹΦεεϝ w ςϯϓϨʔτύλʔϯ͕ͦΜͳʹଟ͘ͳ͍߹ w ։ൃͷ༨༟తʹ·ͩϝʔϧςϯϓϨʔτཧػೳΛ ࡞Εͳ͍߹