public static function getStatus($lead_id = null) { if (is_null($lead_id)) { $lead_id = Conversation::get('lead_id'); } return Lead::where('lead_id', $lead_id)->first()->pluck('auto_stop'); }
/** * Send a single message * * @param $message * @param $lead_id */ private function sendMessage($message, $lead_id = null) { if (is_null($lead_id)) { $lead_id = Conversation::get('lead_id'); } $message = Parser::parseShortcodes($message, Storage::get($lead_id)); $message['metadata'] = 'SENT_BY_GIGA_AI'; $body = ['recipient' => ['id' => $lead_id], 'message' => $message]; Request::send(self::PLATFORM_ENDPOINT . "me/messages?access_token=" . self::$token, $body); }
public function getLeadId() { return $this->conversation->get('lead_id', null); }