Skip to main content

I’m using the function below to submit a new registration but it always fails if I uncomment out the email entry. All the other fields are being passed over to monday without issues, just stuck on email right now and would appreciate any help.


      function send_to_monday($userr) {
$board_id = xxxxxxxxxx;
$api_key = '';

$query = 'mutation ($item_name: String!, $column_values: JSON!) {
create_item (board_id: '.$board_id.', item_name: $item_name, column_values: $column_values) { id } }';

$column_values = array(
// Column values
);

$variables = array(
'item_name' => $userrr'fio'],
'column_values' => json_encode(e
// 'email'=> ;'email'=> $userrr'email']],
'text0'=> $userrr'magent'],
'text5'=> $userrr'country'],
'text50'=> $userrr'town'],
'text43'=> $userrr'port'],
'text3'=> $userrr'skype'],
'text10'=> $userrr'about'],
'phone'=> $userrr'tel'],
'text4'=> $userrr'username'],
'text9'=> $userrr'password'],
'country'=> ;'countryCode'=> $userrr'country']]

])
);

$data = array(
'query' => $query,
'variables' => $variables
);

$headers = array(
'Content-Type: application/json',
'Authorization: '.$api_key
);

$ch = curl_init('https://api.monday.com/v2/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
curl_close($ch);

// Handle response or errors here (if needed)
}

send_to_monday($userr);
$ress = aj_user($userr);
// End Monday.com API integration

You are required to include both the email and text keys in the mutation, even if the text is the email address itself.


'email' => ['email'=> $user['email'], 'text'=> $user['email']]


Thank you @anon29275264 !!


Reply