Commit Graph

9 Commits

Author SHA1 Message Date
Rob Orton 04e7bf8cb8 use inst_statsd
fixes CORE-2538

test plan
 - configure statsd to use data dog
 - it should work

Change-Id: Ie8428e4e99973b35506bd7a8e4d1a18f5a7875a1
Reviewed-on: https://gerrit.instructure.com/182083
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2019-03-25 17:00:49 +00:00
Simon Williams f359f871b1 bump twilio-ruby
Change-Id: I96025376f71751bef2ce4bfc10b2f05ddb5979da
Reviewed-on: https://gerrit.instructure.com/144472
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2018-03-23 15:04:17 +00:00
Simon Williams 44b78bb05c bump twilio-ruby
Change-Id: Ifa6ffd36ef44ad25195321b82f090ac0ec33988b
Reviewed-on: https://gerrit.instructure.com/136459
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2017-12-27 16:15:46 +00:00
Landon Wilkins f1359d33e2 da licença part 27
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: I331826e3e3be8b7d73bbf4f6afe3a79ec1340f54
Reviewed-on: https://gerrit.instructure.com/110051
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-27 21:53:31 +00:00
Cody Cutrer a99d2a3bdc spec: don't allow raise_error with no arguments
most of these are simple fixes, but there are a few where the spec has
actually been broken due to underlying API changes, that were masked
due to the generic raise_error matcher

fixes CNVS-35542

Change-Id: I982e7ab9af59101b79fdf6b2e0816b374a6a6d5b
Reviewed-on: https://gerrit.instructure.com/104750
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-03-10 21:34:37 +00:00
Alex Boyd 750f415722 Look up phone number countries correctly on Rails 4
Rails 4 changes #try to check with respond_to? to see if the
method exists first, and the Twilio API client doesn't actually
make the API request until method_missing is called, so try
falls over and hands back nil. Use try!, which retains the Rails
3 behavior of going straight to public_send, to get around this.

Fixes CNVS-26266

Test plan:
 - Regression test international SMS with an account that owns
   phone numbers in other countries and with recipients in those
   countries
   - Make sure that all international phone numbers in countries
     for which the Twilio account you're testing with owns phone
     numbers receive messages from numbers from those countries,
     and not from U.S. phone numbers

Change-Id: I7333fb2f4965fe0186c530f4e94ee7f9479e58ef
Reviewed-on: https://gerrit.instructure.com/69795
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Alex Boyd <aboyd@instructure.com>
2016-01-09 05:36:01 +00:00
Alex Boyd 17fd70a35f Try to send messages from the recipient's country
Fixes CNVS-24733

Test plan:
 - Set up config/twilio.yml
 - Ensure that your Twilio account owns phone numbers in the U.S.
   and phone numbers in at least one other country
 - Enable both the "International SMS" and "International SMS -
   Send from Recipient's Country" feature flags on the account
   you'll be working with
 - Add a phone number in the U.S. to your profile
 - Cause a notification to be sent to this phone number
 - Ensure that the text message you receive is from one of the
   U.S. phone numbers
 - Add a phone number in a country in which your Twilio account
   owns outbound phone numbers to your profile
 - Cause a notification to be sent to this phone number
 - Ensure that the text message you receive is from one of the
   phone numbers in this country
 - Add a phone number in a country in which your Twilio account
   does not own any outbound numbers
 - Cause a notification to be sent to this phone number
 - Ensure that the text message you receive is from one of the
   U.S. phone numbers
 - Disable the "International SMS - Send from Recipient's
   Country" feature flag
 - Repeat the above steps, but ensure that all text messages to
   all phone numbers are sent from a U.S. phone number

Change-Id: I65b4a7c2e201f8afc5e6068ad80a3b4f9ce8710c
Reviewed-on: https://gerrit.instructure.com/66320
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Allison Weiss <allison@instructure.com>
2015-11-13 18:16:34 +00:00
Alex Boyd ac7e972311 Let StatsD know when messages are sent via Twilio
Fixes CNVS-21546

Test plan N/A (just regression test international SMS messaging)

Change-Id: I135bef152b61b798208548835af20222a65f6b00
Reviewed-on: https://gerrit.instructure.com/61407
Tested-by: Jenkins
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Alex Boyd <aboyd@instructure.com>
2015-09-14 15:46:52 +00:00
Alex Boyd 0fc41e8d5a Send messages via Twilio
Fixes CNVS-21548, CNVS-20625, CNVS-21580

Test plan:
 - Copy config/twilio.yml.example to config/twilio.yml
 - Configure config/twilio.yml with credentials from a Twilio
   account
 - Create a user
 - Enable the international_sms feature flag for the account
   of the user you created
 - Create a communication channel from a Rails console, using
   a phone number with which you can test. Assuming
   1-801-555-0100 as the phone number, and assuming that the
   id of the user that you created is 42, you can do that with:
     User.find(42).communication_channels.create!(
       path_type: 'sms', path: '+18015550100')
 - As a site admin, confirm the user's communication channel
 - Cause a notification to be sent to the user
 - Ensure that you receive a text message
 - Multiple outbound numbers (will need a paid Twilio account
   to test):
   - Configure config/twilio.yml with credentials from a
     Twilio account that has multiple outbound phone numbers
   - Create multiple users and add new phone numbers for each
     using the above steps, and confirm them
   - Cause notifications to be generated for each user and
     ensure that they come from different phone numbers
     - You may need to test several phone numbers before a
       notification is sent from a different number
   - Cause more notifications to be sent and ensure that each
     phone number receives notifications from the same
     outbound phone number every time

Change-Id: I103c93a8096acaaabd29530b0a0b5c43bc05c26b
Reviewed-on: https://gerrit.instructure.com/59901
Tested-by: Jenkins
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2015-09-14 15:46:23 +00:00