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
Rails 6.0 Action Mailboxについて
Search
horikawa
May 15, 2019
Programming
0
400
Rails 6.0 Action Mailboxについて
otemachi.rb#17で発表した資料
horikawa
May 15, 2019
Tweet
Share
More Decks by horikawa
See All by horikawa
Caching associations in rails
casix
1
330
Create Action Mailbox Sample Application
casix
1
420
Rails 4.2→5.2アップデート
casix
0
440
Other Decks in Programming
See All in Programming
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
200
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
140
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
130
MUSUBIXとは
nahisaho
0
140
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1k
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
310
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.5k
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.6k
24時間止められないシステムを守る-医療ITにおけるランサムウェア対策の実際
koukimiura
1
120
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
440
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
270
CSC307 Lecture 02
javiergs
PRO
1
780
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
450
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
79
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Designing for Performance
lara
610
70k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
320
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Embracing the Ebb and Flow
colly
88
5k
Utilizing Notion as your number one productivity tool
mfonobong
3
220
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Transcript
Rails 6.0ͷ Action Mailbox גࣜձࣾπΫϧόɹαʔόαΠυΤϯδχΞ ງɹ@CASIXx1
• ීஈʮcowcamoʯͱ͍͏ΞϓϦΛ։ൃͯ͠ ·͢ • αʔόαΠυɺRailsʢ5.2ʣΛͬͯ·͢
Rails 6.0.0͕ͦΖͦΖग़ͦ͏ʂ
Rails 6.0.0.rc1͕ग़͍ͯΔͷ Ͱɺ΄΅6.0ͷػೳࢼͤΔʂ
৭ʑՃ͞Ε͍ͯΔ
Rails 6.0ͷओཁՃػೳ • Action Text • Action Mailbox • Multiple
Databases • Parallel Testing • Zeitwerk...etc
Action Textͷ ฉ͚͘Ͳɺɺ
Action Mailboxͷฉ͔ͳ͍...
Action Mailboxͷ͜ͱΛ ௐͯΈ·ͨ͠ ʢ·్ͩத·Ͱ͔͠ ࢼͤͯͳ͍ ʣ
ݩʑɺผͷgemͱ࣮ͯ͠͞Ε ͍ͯͨ
Rails 5.2Ͱ͑ͦ͏???
Action Mailboxͷػೳ • ड৴ϝʔϧʹରͯ͠ɺʮRailsʯͰɺॲཧ͢Δʂ • DBS3ʹอଘͨ͠ΓɺAction MailerΛͬͯɺ ࣗಈฦ৴ͨ͠Γ…
4FOE(SJE Ϣʔβʔ ϝʔϧૹ৴ RailsʹHTTP Post ɹ3BJMT "DUJPO.BJMCPY ॲཧ %# อଘ
4
ॳظઃఆ • $ rails action_mailbox:install • ApplicationMailboxΫϥε͕ੜ͞ΕΔ • MailboxΛ֨ೲ͢Δςʔϒϧ͕ੜ͞ΕΔ
app/mailboxes/application_mailbox.rb class ApplicationMailbox < ActionMailbox::Base #
[email protected]
Ѽͷϝʔϧ # ForwardsMailboxΫϥεͰɺॲཧΛߦ͏ routing
/^save@/i => :forwards #
[email protected]
Ѽͷϝʔϧ # RepliesMailboxΫϥεͰɺॲཧΛߦ͏ routing /@replies\./i => :replies end
ϝʔϧɺInboundEmailϞσ ϧͱͯ͠ѻΘΕΔ • class InboundEmail < ActiveRecord::Base • https://github.com/rails/rails/blob/ master/actionmailbox/app/models/
action_mailbox/inbound_email.rb • ActiveStorageͱࣅͨΑ͏ͳײ͡??
SMTPड͚ೖΕઃఆ • config/environments/֤ڥ.rb config.action_mailbox.ingress = # ͜͜ʹαʔϏε໊ # sendgridͷ߹ config.action_mailbox.ingress
= :sendgrid # mailgunͷ߹ config.action_mailbox.ingress = :mailgun # exam, mailgun, mandrill, postfix, postmark, qmail, sendgridΛαϙʔτ͍ͯ͠Δ
ύεϫʔυઃఆ • SendGridͳͲͷϝʔϧαʔϏεͱͷ࿈ܞͰɺ ύεϫʔυ͕ٻΊΒΕΔͷͰɺ ڥม or CredentialͰύεϫʔυΛ RailsଆͰઃఆ͓ͯ͘͠
ϝʔϧαʔϏεଆͷઃఆ ྫɿSendGrid SendGrid͔ΒɺHTTP POSTͯ͠Β͏ʂ https://actionmailbox:password@domain/rails/ action_mailbox/sendgrid/inbound_emails
ศརͳҹ • RspecͳͲͰͷςετॻ͚Δ • ActiveStorageΛ͑ɺS3ͳͲʹอଘͰ͖ΔΒ͠ ͍ • Callbackग़དྷͦ͏ • https://github.com/rails/rails/blob/master/
actionmailbox/lib/action_mailbox/callbacks.rb
ؾʹͳͬͨՕॴ • ϝʔϧαʔϏεଆͷઃఆඞཁʹͳΔ • SendGridͳΒɺInbound ParseͳͲ • Parseͷ༷ཧղ͓͔ͯ͠ͳ͍ͱ͍͚ͳ͍ • SESɺRails
6.1͔ΒͷαϙʔτͱͳΓͦ͏ • https://github.com/rails/rails/commit/ f480cfabcd9000b5817b610e21466299025b12d2 • ެࣜඇެࣜͷυΩϡϝϯτ͕ඇৗʹগͳ͍… • ϝʔϧେྔʹདྷͨΒɺαʔόͲ͏ͳΔͷ͔ͳ…
·ͱΊ
·ͱΊ • Rails AppͰ࿈ܞ͕ඞཁͳ߹ɺॏๅͦ͠ ͏ʂ • ֤ཧऀʹϝʔϧΛసૹͨ͠Γ • ࿈ܞ͕ཁΒͳ͍߹ɺAction Mailbox୯ମ
ͰαʔόཱͯΕྑ͍ؾ…
ऴΘΓ
ࢀߟ • Action Mailbox gem • https://github.com/rails/actionmailbox/tree/master • Rails Guides
• https://edgeguides.rubyonrails.org/ action_mailbox_basics.html • bagelee • https://bagelee.com/programming/ruby-on-rails/rails6- action-mailbox/