$this->client->indices()->create([
'index' => 'app',
'body' => [
'mappings' => [
'user' => [
'_source' => [
'enabled' => true,
],
'properties' => [
'id' => [
'type' => 'integer',
],
'created_at' => [
'type' => 'date',
],
'name' => [
'type' => 'text',
],
'email' => [
'type' => 'text',
],
'status_verify' => [
'type' => 'keyword',
],
'friends' => [
'type' => 'integer',
],
'regions' => [
'type' => 'integer',
],
],
],
],
'settings' => [
'analysis' => [
'char_filter' => [
'replace' => [
'type' => 'mapping',
'mappings' => [
'&=> and '
],
],
],
'analyzer' => [
'default' => [
'type' => 'custom',
'char_filter' => [
'html_strip',
'replace',
],
'tokenizer' => 'whitespace',
'filter' => [
'lowercase',
'word_delimiter',
'trigrams',
],
],
],
],
],
],
]);
$mail = new PHPMailer;
$mail->IsSMTP();
$mail->SMTPDebug = 0;
$mail->Host = "xxxx";
$mail->SMTPAuth = true;
$mail->Username = 'xxxx';
$mail->Password = 'xxx';
$mail->SMTPSecure = "tls";
$mail->Port = 587;
$mail->From = "xxxx";
$mail->FromName = "xxxx";
$mail->addAddress($email, $name);
$mail->isHTML(true);
$mail->Subject = "Bienvenue à l’Anticafé";
$mail->Body = $this->renderView(
'emails/registration.html.twig',
array('name' => $name, 'password' => $password, 'username' => $email)
);
$response = $mail->send() ? 'true' : 'false';