Skip to content

Commit

Permalink
Merge pull request #40 from nestauk/update-welcome-message
Browse files Browse the repository at this point in the history
Update welcome message
  • Loading branch information
cdccollins authored Oct 15, 2024
2 parents df6c7f6 + da907d5 commit 67fb271
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions app/jobs/send_welcome_message_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@ class SendWelcomeMessageJob < ApplicationJob
queue_as :default

WELCOME_VIDEOS = {
17 => "https://www.youtube.com/watch?v=3p6h9f1qk8k",
18 => "https://www.youtube.com/watch?v=3p6h9f1qk8k",
19 => "https://www.youtube.com/watch?v=3p6h9f1qk8k",
20 => "https://www.youtube.com/watch?v=3p6h9f1qk8k",
21 => "https://www.youtube.com/watch?v=3p6h9f1qk8k",
22 => "https://www.youtube.com/watch?v=3p6h9f1qk8k",
23 => "https://www.youtube.com/watch?v=3p6h9f1qk8k",
24 => "https://www.youtube.com/watch?v=3p6h9f1qk8k"
17 => "https://www.bbc.co.uk/tiny-happy-people/tools-for-talking-18-24-months/zxdfp4j",
18 => "https://www.bbc.co.uk/tiny-happy-people/shopping-game-18-24/zbhyf4j",
19 => "https://www.bbc.co.uk/tiny-happy-people/how-to-make-a-ball-run/z4kk8xs",
20 => "",
21 => "https://www.bbc.co.uk/tiny-happy-people/puppet-play-18-24/zj2ht39",
22 => "https://www.bbc.co.uk/tiny-happy-people/lets-play-chefs/z762mfr",
23 => "https://www.bbc.co.uk/tiny-happy-people/mealtime-challenge/zp3wcmn",
}

def perform(user)
message = Message.create do |m|
m.token = m.send(:generate_token)
m.link = WELCOME_VIDEOS[user.child_age_in_months_today]
m.user = user
m.body = "Hi #{user.first_name}, welcome to Tiny Happy People. Here's a video to get you started: #{track_link_url(m.token)}"
m.body = "Welcome to our programme of weekly texts with fun activities! Here's a video to get you started: #{track_link_url(m.token)}"
end

Twilio::Client.new.send_message(message)
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
as: :date,
order: [:month, :year],
wrapper_html: { class: "" },
input_html: { class: "md:w-1/4 mt-3 flex" }
input_html: { class: "md:w-1/2 mt-3 flex" }
%>
</div>

Expand Down

0 comments on commit 67fb271

Please sign in to comment.