Action Mailbox “Examples”
Mail yourself a Postcard Reminder
class PostcardMailbox < ApplicationMailbox
def process
postcardApi = Lob::PostcardsApi.new($lob_config)
postcardCreate = Lob::PostcardEditable.new({
description: "Demo Postcard job",
from: "adr_210a8d4b0b76d77b",
use_type: "operational",
front: “https://FAKE_BUCKET.s3.amazonaws.com/boston_ruby_postcard.png”,
back: "
{{ message }}
”,
to: "adr_123123123123123123",
merge_variables: {
message: mail.body.decoded,
},
});
begin
createdPostcard = postcardApi.create(postcardCreate)
rescue => err
p err.message
end
end
end