diff --git a/include/controllers/default/crunchbutton/api/twilio/sms.php b/include/controllers/default/crunchbutton/api/twilio/sms.php index 6650f40ee..6184d8e4d 100644 --- a/include/controllers/default/crunchbutton/api/twilio/sms.php +++ b/include/controllers/default/crunchbutton/api/twilio/sms.php @@ -175,14 +175,14 @@ class Controller_api_twilio_sms extends Crunchbutton_Controller_Rest { $support->makeACall(); + if( $support->id_support ){ + $message .= ' http://cbtn.io/support/' . $support->id_support . '?r=1'; + } + // Log Log::debug( [ 'action' => 'sms action - support-ask', 'message' => $message, 'type' => 'sms' ] ); $support = Support::getByTwilioSessionId($tsess->id_session_twilio); - - if( $support->id_support ){ - $message .= ' http://cbtn.io/support/' . $support->id_support . '?r=1'; - } $b = $message; diff --git a/include/library/Crunchbutton/Support/Rep.php b/include/library/Crunchbutton/Support/Rep.php index 3e8831ccf..1be8381a0 100644 --- a/include/library/Crunchbutton/Support/Rep.php +++ b/include/library/Crunchbutton/Support/Rep.php @@ -12,7 +12,7 @@ class Crunchbutton_Support_Rep extends Cana_Table { public static function createSupportRep(){ $admin = c::admin(); $rep = new Crunchbutton_Support_Rep(); - $rep->name = c::admin()->name; + $rep->name = c::admin()->login; $rep->phone = c::admin()->txt; $rep->active = 1; $rep->save();