Error message "Class Phalcon\Events\EventsAwareInterface not found and could not be autoloaded." cannot be ignored, use excludes_analyse instead.
volumes:
- ./app:/application
- ./phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/7.1/fpm/conf.d/99-overrides.ini
- ./phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/7.1/cli/conf.d/99-overrides.ini
public function ololoAction()
{
$form_data = $this->request->getJsonRawBody(true);
(new OloloValidation())->assert($form_data);
$id_variable = 'policy_id';
$token_variable = 'object_token';
$per_page_variable = 'per_page';
$query_string = (new JuridicalDmsStructures('alias', [$id_variable => 'Long!', $token_variable => 'String!', $per_page_variable => 'Long!']))
->addStructure($id_variable, $token_variable, false, $per_page_variable)
->build();
$query = [
'query' => $query_string,
'variables' => [
$id_variable => $policy_id,
$token_variable => $object_token,
$per_page_variable => 1
]
];
$result = (new Request())->post('', soglasie_gql_request_options(), $query);
$contract_data = Fractal::create()
->item($result['data']['data']['policy'], OloloTransformer::class)
->serializeWith(WithoutDataKeySerializer::class)
->toArray();
if(!isset($contract_data['manager']['work_email'])){
throw new UserableException($this->t->_('mailer.failed_to_get_manager_email'));
}
// Отправляем на почту
/** @var \Phalcon\Mailer\Manager $mailer */
$mailer = $this->di->getShared('mailer');
$mail = $mailer->createMessageFromView(
'view_path',
['form_data' => $form_data, 'contract_data' => $contract_data]
)
->to($contract_data['manager']['work_email'])
->subject($this->t->_('mailer.juridical_dms_add_insured_theme'));
$count = $mail->send();
$this->logger->log(
Logger::INFO,
"Отправка письма\n"
. "Текст письма: {content}\n"
. "Email: {curator_email}\n"
. "Кол-во отправленных писем: {status}\n",
[
'content' => $mail->getContent(),
'curator_email' => $contract_data['manager']['work_email'],
'status' => $count
]
);
if (!$count) {
throw new UserableException($this->t->_('mailer.failed_to_send_email'));
}
}