greet_mailbox.rb
class GreetMailbox < ApplicationMailbox
def process
GreetMailer.greet(inbound_email).deliver_now
end
end
process ͷதʹॲཧΛॻ͘ɻ
Action MailerͰฦ͚ͩ͢ɻ
Slide 63
Slide 63 text
registration_mailbox.rb
from_address = mail.from.first
local_part_of_to = mail.to.first.split("@").first
user = User.find_by(uuid: local_part_of_to)
if user != nil
if user.redeemed? == false
user.email = from_address
user.save
IssuerMailer.with(user: user).issue(inbound_email).deliver_now
else
if user.email == from_address
IssuerMailer.with(user: user).issue(inbound_email).deliver_now
else
bounce_with BounceMailer.already_redeemed(inbound_email)
end
end
else
bounce_with BounceMailer.bounce(inbound_email)
end