Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## ActionMailbox
- — rails 6 feature
- — needs ruby >= 2.5.0
- ## Setup
- — rails action_mailbox:install && rails db:migrate
- — pick a mail provider
- — setup inbound routes
- — generate mailbox for each route
- — create mailbox tables in db
- — put the app on heroku/ngrok/whatever (emails can’t go to localhost)
- — (also google ngrok man says it’s important)
- — set up mail forwarders and ENV variables
- — add one line to rails config files
- — route everything to your mail controller, pick the name that makes sense
- — rails g mailbox [name]
- ## what you can do with mail object
- — it’s a LOT (look at the docs)
- — store email in database by making a DB model
- — mail.body contains hella html boilerplate, mail.body.decoded is just the content
- — man demos tone analysis on email (like, checking the tone of language) (talk about how great this would be for customer service departments)
- — he uses IBM Watson api to analyze the tone of the emails (whoa!)
- — !!! important — learn tone analysis/other fun ai tricks because it’s cool and fun and not too difficult and impresses people
- — IBM Watson is free for the first 1000 requests
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement