<commit_before>module TextMessagesHelper
  def TextMessagesHelper.send_text_messages_to_invitees_and_planner(event)
    p "in send_text_messages_to_invitees_and_planner "

    client = Twilio::REST::Client.new ENV['TWILIO_ACCOUNT_SID'], ENV['TWILIO_AUTH_TOKEN']


    from = ENV['TWILIO_PHONE_NUMBER'] # Your Twilio number

    # send message to invitees
    event.invitations.each do |invitation|
      client.account.messages.create(
        :from => from,
        :to => invitation.phone_number,
        :body => "Hey #{invitation.full_name}, yo I'm hangry. Let's grub. Fill out this form asap: http://restaurant-roullete.herokuapp.com/events/#{event.id}/preferences"
      )
      puts "Sent invitation message to invitee: #{invitation.full_name}"
    end

    # send message to planner
    client.account.messages.create(
      :from => from,
      :to => event.planner.phone_number,
      :body => "Hey #{event.planner.full_name}, We're going out for food. Fill out this form: http://restaurant-roullete.herokuapp.com/events/#{event.id}/preferences"
    )<commit_msg>Bug fix: Update messaging logic for planner<commit_after>module TextMessagesHelper
  def TextMessagesHelper.send_text_messages_to_invitees_and_planner(event)
    p "in send_text_messages_to_invitees_and_planner "

    client = Twilio::REST::Client.new ENV['TWILIO_ACCOUNT_SID'], ENV['TWILIO_AUTH_TOKEN']


    from = ENV['TWILIO_PHONE_NUMBER'] # Your Twilio number

    # send message to invitees
    event.invitations.each do |invitation|
      client.account.messages.create(
        :from => from,
        :to => invitation.phone_number,
        :body => "Hey #{invitation.full_name}, yo I'm hangry. Let's grub. Fill out this form asap: http://restaurant-roullete.herokuapp.com/events/#{event.id}/preferences"
      )
      puts "Sent invitation message to invitee: #{invitation.full_name}"
    end

    # send message to planner
    client.account.messages.create(
      :from => from,
      :to => event.planner.phone_number,
      :body => "Hey #{event.planner.full_name}, yo I'm hangry. Let's grub. Fill out this form asap: http://restaurant-roullete.herokuapp.com/events/#{event.id}/preferences"
    )
{'fraction_non_alphanumeric': 0.11686526122823097, 'fraction_numerical': 0.0, 'mean_word_length': 3.7353579175704987, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '109765', 'n_tokens_mistral': 736, 'n_tokens_neox': 702, 'n_words': 151}