Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.75 KB | None | 0 0
  1. BPF Senior Engineer Take Home Challenge
  2.  
  3. **Background:**
  4.  
  5. At Better Place Forests, we take our brand and our customer communications very seriously. We pride ourselves on our ability to deliver actionable, and personalized communications to our customers exactly when (and only when) they need it. Using text messages to stay in touch with our customers as they make their way through the sales funnel is an excellent tool we can leverage. That being said, asking our sales team and forest steward team to manually type out and send texts 7 days, 3 days, or 1 day before a customer visits the forest of their choosing to pick out a tree does not scale.
  6.  
  7. **Goal:**
  8.  
  9. We need a way to programmatically send out dynamic text messages to our customers containing information that is only relevant to them and their scheduled upcoming visit to the forest. Our marketing and sales teams are constantly improving our messaging to our customers, so these text messages need to be editable and configurable by anyone at BPF. Additionally, we need to expose an endpoint to an external service that will handle the timing and to trigger sending the messages. This external service will try to ping your app to tell you which text message to send, and to whom.
  10.  
  11. **Requirements:**
  12.  
  13. * Your app will have a UI to manage custom text messages.
  14. * Your app will be able to support merge tags in the text messages.
  15. * Your app will need to be able to listen to an external service sending POST requests that show up when a particular text message should be sent.
  16. * Your app will parse the payload of this incoming message which contains the information necessary to identify a customer as well as which text to send to this customer.
  17. * Your app will support functionality around manually sending out any text messages to a given customer based on their email address.
  18. * Your app will provide a way to view all text messages that have been sent so to ensure that our customers are getting exactly the right information (and that it is formatted correctly).
  19. * Your app will have a database of customers that can be queried based on email address to find necessary information to populate merge tags and phone numbers
  20.  
  21.  
  22. **Notes:**
  23.  
  24. This application should be written to production ready quality. Please provide all documentation, testing, etc to facilitate this. We use Rails at Better Place Forests, so please show us your skillset in this framework when implementing this feature. Additionally, our front ends are built on top of bootstrap for styling. This is not a requirement of this project, but having a thoughtfully presented UI will help usability for non-technical people.
  25.  
  26.  
  27. **Freebies:**
  28.  
  29. For the purposes of this example, please use this fake internal gem that exposes a class to actually mock-send messages:
  30.  
  31. ```
  32. module BPF
  33. class Text
  34. attr_accessor :status, :message
  35.  
  36. def initialize(response)
  37. @status = response[:status]
  38. @message = response[:message]
  39. end
  40.  
  41. def self.send(to_number, from_number, body)
  42. ## Text sending magic here ##
  43.  
  44. ## For simplicity,
  45. ## this is a black box that
  46. ## returns a success hash or an error hash at pseudo-random
  47. message_sent = [true, false, true, true].sample
  48.  
  49. if message_sent
  50. response = {status: "success", message: body}
  51. else
  52. response = {status: "error", message: "Bad number"}
  53. end
  54.  
  55. new(response)
  56. end
  57. end
  58. end
  59. ```
  60.  
  61.  
  62. **Deliverables**:
  63.  
  64. Please provide your work in a publicly available github repository. Additionally please document all necessary steps to run your app locally to test its functionality.
  65.  
  66. Bonus points if you also provide a link to a working version of your app. (We use Heroku for all application hosting at BPF)
  67.  
  68. **Timeline:**
  69.  
  70. This task should take you no longer than 3 days.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement