From 6c05fbe3a53f79caca16ab8b447b93b400cee8fb Mon Sep 17 00:00:00 2001 From: Korzinkayablok Date: Tue, 24 Aug 2021 17:19:41 +0300 Subject: [PATCH] Message format change --- frontend/modules/api/controllers/ProfileController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/modules/api/controllers/ProfileController.php b/frontend/modules/api/controllers/ProfileController.php index 8016057..5d1ff3f 100644 --- a/frontend/modules/api/controllers/ProfileController.php +++ b/frontend/modules/api/controllers/ProfileController.php @@ -67,11 +67,16 @@ class ProfileController extends \yii\rest\Controller $model->created_at = time(); $model->user_id = \Yii::$app->user->id; - if ($model->save()){ + if ($model->save()) { $token = \Yii::$app->params['telegramBotToken']; $chat_id = \Yii::$app->params['telegramBotChatId']; - $message = "Пришёл запрос на интервью.\nПрофиль: {$attributes['profile_id']}\nТелефон: {$attributes['phone']}\nEmail: {$attributes['email']}\nКомментарий: {$attributes['comment']}"; + $message = + "Пришёл запрос на интервью.\n". + "Профиль: {$attributes['profile_id']}\n". + "Телефон: {$attributes['phone']}\n". + "Email: {$attributes['email']}\n". + "Комментарий: {$attributes['comment']}"; $bot = new TelegramBotService($token); $bot->sendMessageTo($chat_id, $message);