You are here

function twilio_admin_test_form_submit in Twilio 7

Submit handler for the administrative test message testing form.

File

./twilio.admin.inc, line 148
Administrative forms section

Code

function twilio_admin_test_form_submit($form, &$form_state) {
  $sent = twilio_send($form_state['values']['number'], $form_state['values']['message'], $form_state['values']['country'], !empty($form_state['values']['media']) ? $form_state['values']['media'] : NULL);
  if ($sent) {
    drupal_set_message(t('Your message has been sent'));
  }
  else {
    drupal_set_message(t('Unable to send your message.'), 'error');
  }
}