Expected unqualified-id before string constant

hello, I am trying a project I found on hackster.io It is about a "smart" mailbox, that sends you an email when you get mail. But now I have this error. (Also should I use both files or would just one work?) I am using Arduino IDE

Please help quickly as I am stuck.

#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include "wpa2_enterprise.h"
#include "config.h"

#define TRIG_PIN D3
#define ECHO_PIN D5
#define LED_PIN D8
#define BUTTON_PIN D7

#define LED_OFF 0
#define LED_ON 1
#define LED_BLINK 2
#define LED_75_ON 3
#define LED_25_ON 4
#define LED_BLINK_HALF 5
#define LED_BLINK_1T 6
#define LED_BLINK_2T 7
#define LED_BLINK_EVERY_10T 8
#define LED_BLINK_XT 9


"Trigger" : const String url = "/trigger/" + trigger + "/with/key/" + key;      (RIGHT HERE IS THE ERROR) 


int nbr_of_new_letters = 0;
int total_nbr_of_letters = 0;
unsigned long time_of_last_letter = 0;
bool letter_detected = false;

double previous_distance = 0;
double distance_bottom = 0;

int led_state = LED_BLINK;
bool do_chip_reboot = false;

WiFiClientSecure client;

void setup() {
  Serial.begin(115200);
  pinMode(TRIG_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);
  pinMode(BUTTON_PIN, INPUT);
  pinMode(LED_PIN, OUTPUT);
  digitalWrite(LED_PIN, HIGH);
  wifi_station_set_auto_connect(0);
  distance_bottom = mesureDistance();  
  WiFi.mode( WIFI_OFF );
  WiFi.forceSleepBegin();
  Serial.println("WiFi is down");
  attachInterrupt(digitalPinToInterrupt(BUTTON_PIN), rebootChip, RISING);
  do_chip_reboot = false;
  timer1_isr_init();
  timer1_attachInterrupt(ledInterrupt);
  timer1_enable(TIM_DIV256, TIM_EDGE, TIM_LOOP);
  timer1_write(1000);
}

void loop() {
  delay(0); //To allow for background WiFi related operations to be performed

  if (do_chip_reboot){
    led_state = LED_OFF;
    Serial.println("Button pressed, the chip will reboot in " + String(button_timer) + "s");
    delay(button_timer*1000);
    ESP.restart();
    do_chip_reboot = false;
  }
}

  if ((millis() - time_of_last_letter) > time_between_two_letters_are_detected*1000 && isNewObjectDetected()) {
    nbr_of_new_letters ++;
    total_nbr_of_letters ++;
  }

  delay(time_between_two_measurements);

  if (nbr_of_new_letters > 0) {
    led_state = LED_75_ON ;
    int time_temp = int(time_before_weebhook_is_triggered) - int((millis() - time_of_last_letter)/1000);
    if (time_temp>=0){
      Serial.print(" Weebhook will be triggered in ");
      Serial.print(time_temp);
      Serial.print("s, ");
      Serial.print(nbr_of_new_letters);
      Serial.println(" letter(s) detected");
    } else {
      Serial.println("Connection to WiFi is taking : "+ String(-time_temp) + "s");
    }
  } else {
    if (total_nbr_of_letters > 0){
      led_state = LED_BLINK_2T ;
    } else {
      led_state = LED_BLINK_EVERY_10T ;
    }
  }

  if (nbr_of_new_letters > 0 && (millis() - time_of_last_letter) > time_before_weebhook_is_triggered * 1000 ) {
    if (wifi_get_opmode() == WIFI_OFF ){
      Serial.println("Starting WiFi connection");
      connectWifi();
    } else if (WiFi.status() == WL_CONNECTED){
      led_state = LED_ON ;
      Serial.println("WiFi connected");
      Serial.print("IP address: ");
      Serial.println(WiFi.localIP());
      Serial.print("Netmask: ");
      Serial.println(WiFi.subnetMask());
      Serial.print("Gateway: ");
      Serial.println(WiFi.gatewayIP());
      Serial.println("Starting weebhook triggering");
      if (sendIFTTTRequest()) {
        Serial.println("Weebhook triggered");
        nbr_of_new_letters = 0;
      } else {
        Serial.println("Failed to trigger weebhook, retrying in 2s");
      }
      delay(2000);
    } else {
      led_state = LED_BLINK_HALF ;
      Serial.print("CONNECTING TO WIFI : ");
      Serial.println(wifi_station_get_connect_status() );
      /*  STATION_IDLE  = 0,
       *  STATION_CONNECTING = 1,
       *  STATION_WRONG_PASSWORD = 2,
       *  STATION_NO_AP_FOUND = 3,
       *  STATION_CONNECT_FAIL = 4,
       *  STATION_GOT_IP = 5
       */
    }
  }
  Serial.println();
}




bool sendIFTTTRequest() {
  // Use WiFiClient class to create TCP connections
  //WiFiClientSecure client;
  //const int API_TIMEOUT = 10000;
  /*
  if (connectWifi() == false) {
    return false;
  }
  */
  client.setInsecure();

  Serial.print("Connecting to ");
  Serial.println(host);

  int connect_code = client.connect(host, httpsPort);
  Serial.println(connect_code);
  if (!connect_code) {
    Serial.println("Connection failed");
    closeConnection(client);
    return false;
  }

  Serial.print("Posting json to URL: ");
  Serial.println(url);

  String json = "{\"value1\": "+ String(nbr_of_new_letters) +",\"value2\": "+ String(total_nbr_of_letters) +",\"value3\": 100}";
  Serial.print("JSON content: ");
  Serial.println(json);
 
  // This will send the request to the server
  client.print("GET " + url + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" +
               "User-Agent: esp8266\r\n" +
               "Content-Type: application/json\r\n" +
               "Accept: */*\r\n"+
               "Content-Length: "+json.length()+"\r\n"+
               "\r\n" +
               json);
  delay(500);

  closeConnection(client);
  return true;
}




bool connectWifi() {
  
  if (WiFi.status() == WL_CONNECTED) {
    return true;
  }

  WiFi.forceSleepWake();
  delay(1);
  wifi_set_opmode_current(STATION_MODE);
  
  if (WPA2_Entreprise_enabled) {
    wifi_station_disconnect();

    struct station_config stationConf;
    stationConf.bssid_set = 0;  //need not check MAC address of AP
    char char_ssid[32] = "";
    char char_password[64] = "";
    ssid.toCharArray(char_ssid, 32);
    password.toCharArray(char_password, 64);
    memcpy(&stationConf.ssid, char_ssid, os_strlen(char_ssid));
    memcpy(&stationConf.password, char_password, os_strlen(char_password));

    if (!wifi_station_set_config(&stationConf)) {
      Serial.print("\r\nset config fail\r\n");
    }
    wifi_station_set_wpa2_enterprise_auth(1);

    char char_username[32] = "";
    username.toCharArray(char_username, 32);
    static u8 ent_username[32] = "";
    for (int i = 0; i < 32; i++) {
      ent_username[i] = u8(char_username[i]);
    }
    static u8 ent_password[] = "test";
    for (int i = 0; i < 64; i++) {
      ent_password[i] = u8(char_password[i]);
    }


    if (wifi_station_set_enterprise_username (ent_username, sizeof(ent_username))) {
      Serial.print("\r\nusername set fail\r\n");
    }

    if (wifi_station_set_enterprise_password (ent_password, sizeof(ent_password))) {
      Serial.print("\r\npassword set fail\r\n");
    }

    wifi_station_connect();

  } else {
    wifi_station_set_wpa2_enterprise_auth(0);
    WiFi.begin(ssid, password);
  }
}


void closeConnection(WiFiClient myClient) {
  myClient.stop();
  WiFi.disconnect();
  Serial.println("Wifi connection closed");
  WiFi.mode( WIFI_OFF );
  WiFi.forceSleepBegin();
  Serial.println("WiFi is down");
}



bool isNewObjectDetected() {
  double distance = mesureDistance();
  Serial.print("Measured distance is : ");
  Serial.print(distance);
  Serial.println(" cm");
  Serial.print("Measured distance was : ");
  Serial.print(previous_distance);
  Serial.println(" cm");
  Serial.print("Distance from bottom is: ");
  Serial.print(distance_bottom);
  Serial.println(" cm");
  double moyenne_distance = previous_distance;
  double last_10_distances[10];
  
  int nbr_mesure = 1;
  if (distance > moyenne_distance * 1.01 || distance < moyenne_distance * 0.99) {
    Serial.println("Measured distance is too far from previous distance, more measurments will be done");
    last_10_distances[1] = distance;
    for (int i = 1; i < 10; i++) {
      last_10_distances[i] = 10000;
    }
  }
  while (nbr_mesure < 100 && distance > moyenne_distance * 1.01 || distance < moyenne_distance * 0.99) {
    moyenne_distance = 0;
    for (int i = 0; i < 10; i++) {
      moyenne_distance += last_10_distances[i];
    }
    moyenne_distance = moyenne_distance / 10;
    last_10_distances[nbr_mesure % 10] = distance;
    nbr_mesure++;
    delayMicroseconds(min_time_before_next_ultrasonic);
    //Serial.println(moyenne_distance);
    distance = mesureDistance();
  }

  Serial.print("Distance was found to be ");
  Serial.print(moyenne_distance);
  Serial.print(" after ");
  Serial.print(nbr_mesure);
  Serial.println(" measurements");

  distance_bottom = distance_bottom*0.99 + moyenne_distance * 0.01;
  
  if (letter_detected == false){
    if (nbr_mesure == 100 || moyenne_distance > (distance_bottom + distance_change_to_detect) || moyenne_distance < (distance_bottom - distance_change_to_detect)) {
      if (nbr_mesure == 100) {
        Serial.println("distance mesurment took " + String(nbr_mesure ) + " iteration");
      } else if (moyenne_distance < distance_bottom - 0.5) {
        Serial.print("Measured distance is more than ");
        Serial.print(distance_change_to_detect);
        Serial.println(" cm shorter than previous distance : a letter has been detected");
        time_of_last_letter = millis();
        previous_distance = moyenne_distance;
        letter_detected = true;
        return true;
      }
    }
  } else {
    if (moyenne_distance > distance_bottom - 0.5){
      Serial.println("The letter is no longer detected");
      letter_detected = false;
    }
  }
    
  previous_distance = moyenne_distance;
  return false;
}





double mesureDistance() {
  double time_to_echo = 0;
  digitalWrite(TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);
  time_to_echo += pulseIn(ECHO_PIN, HIGH);

  return time_to_echo * 0.01731;

  /* La formule qui donne la vitesse du son dans l'air (en m/s) en fonction de la température est: 20.05 * sqrt(temperature en Kelvin).
     En multipliant cette vitesse par le temps que mettent les ultrasons à faire un aller retour, on obtient la distance parcourue par les ultrasons.
     Puisque la distance qui nous interesse est la distance entre l'émetteur et l'objet, on divise la distance par deux (pour n'avoir la distance que d'un aller)
     La vitesse du son est en mètres par secondes, or le temps mesuré est en microsecondes. Il faut donc multiplier le temps mesuré par 10^-6.
     La distance obtenue est alors en mètres. Pour avoir la distance en centimètres, il faut donc multiplier la distance par 10^2.
     Ici ce n'est pas l'exactitude de la mesure qui importe. On simplifie donc en supposant que la température est constament de 25 degré Celsius, soit 298,15 degrés Kelvin.
     Ob obtient alors la formule suivante :
     distance = (temps * 10^-6 * (20.05 * sqrt(298.15)) )/2 * 10^2
     Simplifiable en : distance = temps * 0.01731018814
  */
}


ICACHE_RAM_ATTR void ledInterrupt(){
  static int led_cpt = 0;
  led_cpt++;
  led_cpt = led_cpt%led_timer_max;
  static int nbr_repete = 0;
  switch (led_state){
    case LED_OFF :
        digitalWrite(LED_PIN, LOW);
      break;
    case LED_ON :
        digitalWrite(LED_PIN, HIGH);
      break;
    case LED_BLINK :
      if (led_cpt > led_timer_max*0.5){
        digitalWrite(LED_PIN, HIGH);
      } else {
        digitalWrite(LED_PIN, LOW);
      }
      break;
    case LED_75_ON :
      if (led_cpt < led_timer_max*0.75){
        digitalWrite(LED_PIN, HIGH);
      } else {
        digitalWrite(LED_PIN, LOW);
      }
      break;
    case LED_25_ON:
      if (led_cpt < led_timer_max*0.25){
        digitalWrite(LED_PIN, HIGH);
      } else {
        digitalWrite(LED_PIN, LOW);
      }
      break;
    case LED_BLINK_HALF : 
      if (led_cpt%(int(led_timer_max*0.5)) < led_timer_max*0.25){
        digitalWrite(LED_PIN, HIGH);
      } else {
        digitalWrite(LED_PIN, LOW);
      }
      break;
    case LED_BLINK_1T:
      if (led_cpt < led_timer_max*0.05){
        digitalWrite(LED_PIN, HIGH);
      } else {
        digitalWrite(LED_PIN, LOW);
      }
      break;
    case LED_BLINK_2T:
      if (led_cpt < led_timer_max*0.05 || (led_cpt > led_timer_max*0.10 && led_cpt < led_timer_max*0.15)){
        digitalWrite(LED_PIN, HIGH);
      } else {
        digitalWrite(LED_PIN, LOW);
      }
      break;
    case LED_BLINK_EVERY_10T :
      if (led_cpt == 0){
        nbr_repete +=1;
      }
      if (nbr_repete >=10){
        if (led_cpt < led_timer_max*0.05){
          digitalWrite(LED_PIN, HIGH);
        } else {
          digitalWrite(LED_PIN, LOW);
          nbr_repete = 0;
        }
      }
      break;
  }
}


ICACHE_RAM_ATTR void rebootChip(){
  do_chip_reboot = true;
}     break;
    case LED_BLINK_XT :
      //TODO
 

Thank you for your time.

Read the sticky at the top of the forum "Read this before posting a programming question".

Your attempt at posting code is messed up with the forum word processor. (I.E., difficult, if not unreadable).

Alright, How about now? I fixed it (I hope).

That's an unusual construct -what is it?

I am not entirely sure, as I Just copied and pasted the code from this project right here:

I am not sure if this can help, but here is my full error message(s):

TEST_FOR_MAIL:23:1: error: expected unqualified-id before string constant
23 | "Trigger"; : const String url = "/trigger/" + trigger + "/with/key/" + key;
| ^~~~~~~~~
TEST_FOR_MAIL:23:12: error: expected unqualified-id before ':' token
23 | "Trigger"; : const String url = "/trigger/" + trigger + "/with/key/" + key;
| ^
/Users/Daniel/TEST_FOR_MAIL/TEST_FOR_MAIL.ino: In function 'void setup()':
TEST_FOR_MAIL:47:21: error: 'mesureDistance' was not declared in this scope
47 | distance_bottom = mesureDistance();
| ^~~~~~~~~~~~~~
TEST_FOR_MAIL:51:54: error: 'rebootChip' was not declared in this scope
51 | attachInterrupt(digitalPinToInterrupt(BUTTON_PIN), rebootChip, RISING);
| ^~~~~~~~~~
TEST_FOR_MAIL:54:26: error: 'ledInterrupt' was not declared in this scope; did you mean 'noInterrupts'?
54 | timer1_attachInterrupt(ledInterrupt);
| ^~~~~~~~~~~~
| noInterrupts
/Users/Daniel/TEST_FOR_MAIL/TEST_FOR_MAIL.ino: In function 'void loop()':
TEST_FOR_MAIL:64:72: error: 'button_timer' was not declared in this scope
64 | Serial.println("Button pressed, the chip will reboot in " + String(button_timer) + "s");
| ^~~~~~~~~~~~
/Users/Daniel/TEST_FOR_MAIL/TEST_FOR_MAIL.ino: At global scope:
TEST_FOR_MAIL:71:3: error: expected unqualified-id before 'if'
71 | if ((millis() - time_of_last_letter) > time_between_two_letters_are_detected*1000 && isNewObjectDetected()) {
| ^~
TEST_FOR_MAIL:76:8: error: expected constructor, destructor, or type conversion before '(' token
76 | delay(time_between_two_measurements);
| ^
TEST_FOR_MAIL:78:3: error: expected unqualified-id before 'if'
78 | if (nbr_of_new_letters > 0) {
| ^~
TEST_FOR_MAIL:90:5: error: expected unqualified-id before 'else'
90 | } else {
| ^~~~
TEST_FOR_MAIL:98:3: error: expected unqualified-id before 'if'
98 | if (nbr_of_new_letters > 0 && (millis() - time_of_last_letter) > time_before_weebhook_is_triggered * 1000 ) {
| ^~
TEST_FOR_MAIL:132:3: error: 'Serial' does not name a type
132 | Serial.println();
| ^~~~~~
TEST_FOR_MAIL:133:1: error: expected declaration before '}' token
133 | }
| ^
/Users/Daniel/TEST_FOR_MAIL/TEST_FOR_MAIL.ino: In function 'bool sendIFTTTRequest()':
TEST_FOR_MAIL:150:18: error: 'host' was not declared in this scope
150 | Serial.println(host);
| ^~~~
TEST_FOR_MAIL:152:43: error: 'httpsPort' was not declared in this scope
152 | int connect_code = client.connect(host, httpsPort);
| ^~~~~~~~~
TEST_FOR_MAIL:156:5: error: 'closeConnection' was not declared in this scope
156 | closeConnection(client);
| ^~~~~~~~~~~~~~~
TEST_FOR_MAIL:161:18: error: 'url' was not declared in this scope
161 | Serial.println(url);
| ^~~
TEST_FOR_MAIL:178:3: error: 'closeConnection' was not declared in this scope
178 | closeConnection(client);
| ^~~~~~~~~~~~~~~
/Users/Daniel/TEST_FOR_MAIL/TEST_FOR_MAIL.ino: In function 'bool connectWifi()':
TEST_FOR_MAIL:195:7: error: 'WPA2_Entreprise_enabled' was not declared in this scope
195 | if (WPA2_Entreprise_enabled) {
| ^~~~~~~~~~~~~~~~~~~~~~~
TEST_FOR_MAIL:202:5: error: 'ssid' was not declared in this scope
202 | ssid.toCharArray(char_ssid, 32);
| ^~~~
TEST_FOR_MAIL:203:5: error: 'password' was not declared in this scope
203 | password.toCharArray(char_password, 64);
| ^~~~~~~~
TEST_FOR_MAIL:213:5: error: 'username' was not declared in this scope
213 | username.toCharArray(char_username, 32);
| ^~~~~~~~
TEST_FOR_MAIL:236:16: error: 'ssid' was not declared in this scope
236 | WiFi.begin(ssid, password);
| ^~~~
TEST_FOR_MAIL:236:22: error: 'password' was not declared in this scope
236 | WiFi.begin(ssid, password);
| ^~~~~~~~
/Users/Daniel/TEST_FOR_MAIL/TEST_FOR_MAIL.ino: In function 'bool isNewObjectDetected()':
TEST_FOR_MAIL:253:21: error: 'mesureDistance' was not declared in this scope
253 | double distance = mesureDistance();
| ^~~~~~~~~~~~~~
TEST_FOR_MAIL:282:23: error: 'min_time_before_next_ultrasonic' was not declared in this scope
282 | delayMicroseconds(min_time_before_next_ultrasonic);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST_FOR_MAIL:296:68: error: 'distance_change_to_detect' was not declared in this scope
296 | if (nbr_mesure == 100 || moyenne_distance > (distance_bottom + distance_change_to_detect) || moyenne_distance < (distance_bottom - distance_change_to_detect)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Daniel/TEST_FOR_MAIL/TEST_FOR_MAIL.ino: In function 'void ledInterrupt()':
TEST_FOR_MAIL:349:21: error: 'led_timer_max' was not declared in this scope
349 | led_cpt = led_cpt%led_timer_max;
| ^~~~~~~~~~~~~
exit status 1
expected unqualified-id before string constant

Where is that code from? All I see is code like this:

#define LED_BLINK_HALF 5
#define LED_BLINK_1T 6
#define LED_BLINK_2T 7
#define LED_BLINK_EVERY_10T 8
#define LED_BLINK_XT 9


const String url = "/trigger/" + trigger + "/with/key/" + key;


int nbr_of_new_letters = 0;
int total_nbr_of_letters = 0;
unsigned long time_of_last_letter = 0;

from Boite-aux-lettres/main.ino at master · Matheo-Moinet/Boite-aux-lettres · GitHub. No "Trigger" in front of the const String url line.

No, I can't see that line.

Like I said, I took the code from the project. There was a link to a GitHub page, which then it led me to this code.

The original line was `const String url = "/trigger/" + trigger + "/with/key/" + key;

I only added the "Trigger" : Because it told me that I needed to add that.

That is saying that led_timer_max was not declared in this scope
What's the question?

led_timer_max is only used in the function:
ICACHE_RAM_ATTR void ledInterrupt(){
But led_timer_max is neither declared as a global or in the function where it is used.

Could there be a missing .h file?
(I only looked at the last error. The others are probably generated by the same problem.)

I am not sure if I am missing an .h file. How can I check that? I am pretty new to this, so I don't know much

I don't understand that.
Why would you just stick it where you did?

I put it there because the first time, I got this error, and I thought that I had to "stick" it in there.

When did it become acceptable to post pictures of code and pictures of error messages?

If you were missing an .h file, you would have gotten a missing file in the error messages.

What's in your config.h file?

um, is that bad or what?

Screenshots are meaningless. See the "Copy Error Messages" button? Use it and paste the error messages.

Arduino: 1.8.15 (Mac OS X), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"

TEST_FOR_MAIL:23:34: error: 'trigger' was not declared in this scope
23 | const String url = "/trigger/" + trigger + "/with/key/" + key;
| ^~~~~~~
TEST_FOR_MAIL:23:59: error: 'key' was not declared in this scope; did you mean 'key_t'?
23 | const String url = "/trigger/" + trigger + "/with/key/" + key;
| ^~~
| key_t
/Users/Daniel/TEST_FOR_MAIL/TEST_FOR_MAIL.ino: In function 'void setup()':
TEST_FOR_MAIL:47:21: error: 'mesureDistance' was not declared in this scope
47 | distance_bottom = mesureDistance();
| ^~~~~~~~~~~~~~
TEST_FOR_MAIL:51:54: error: 'rebootChip' was not declared in this scope
51 | attachInterrupt(digitalPinToInterrupt(BUTTON_PIN), rebootChip, RISING);
| ^~~~~~~~~~
TEST_FOR_MAIL:54:26: error: 'ledInterrupt' was not declared in this scope; did you mean 'noInterrupts'?
54 | timer1_attachInterrupt(ledInterrupt);
| ^~~~~~~~~~~~
| noInterrupts
/Users/Daniel/TEST_FOR_MAIL/TEST_FOR_MAIL.ino: In function 'void loop()':
TEST_FOR_MAIL:64:72: error: 'button_timer' was not declared in this scope
64 | Serial.println("Button pressed, the chip will reboot in " + String(button_timer) + "s");
| ^~~~~~~~~~~~
/Users/Daniel/TEST_FOR_MAIL/TEST_FOR_MAIL.ino: At global scope:
TEST_FOR_MAIL:71:3: error: expected unqualified-id before 'if'
71 | if ((millis() - time_of_last_letter) > time_between_two_letters_are_detected*1000 && isNewObjectDetected()) {
| ^~
TEST_FOR_MAIL:76:8: error: expected constructor, destructor, or type conversion before '(' token
76 | delay(time_between_two_measurements);
| ^
TEST_FOR_MAIL:78:3: error: expected unqualified-id before 'if'
78 | if (nbr_of_new_letters > 0) {
| ^~
TEST_FOR_MAIL:90:5: error: expected unqualified-id before 'else'
90 | } else {
| ^~~~
TEST_FOR_MAIL:98:3: error: expected unqualified-id before 'if'
98 | if (nbr_of_new_letters > 0 && (millis() - time_of_last_letter) > time_before_weebhook_is_triggered * 1000 ) {
| ^~
TEST_FOR_MAIL:132:3: error: 'Serial' does not name a type
132 | Serial.println();
| ^~~~~~
TEST_FOR_MAIL:133:1: error: expected declaration before '}' token
133 | }
| ^
/Users/Daniel/TEST_FOR_MAIL/TEST_FOR_MAIL.ino: In function 'bool sendIFTTTRequest()':
TEST_FOR_MAIL:150:18: error: 'host' was not declared in this scope
150 | Serial.println(host);
| ^~~~
TEST_FOR_MAIL:152:43: error: 'httpsPort' was not declared in this scope
152 | int connect_code = client.connect(host, httpsPort);
| ^~~~~~~~~
TEST_FOR_MAIL:156:5: error: 'closeConnection' was not declared in this scope
156 | closeConnection(client);
| ^~~~~~~~~~~~~~~
TEST_FOR_MAIL:178:3: error: 'closeConnection' was not declared in this scope
178 | closeConnection(client);
| ^~~~~~~~~~~~~~~
/Users/Daniel/TEST_FOR_MAIL/TEST_FOR_MAIL.ino: In function 'bool connectWifi()':
TEST_FOR_MAIL:195:7: error: 'WPA2_Entreprise_enabled' was not declared in this scope
195 | if (WPA2_Entreprise_enabled) {
| ^~~~~~~~~~~~~~~~~~~~~~~
TEST_FOR_MAIL:202:5: error: 'ssid' was not declared in this scope
202 | ssid.toCharArray(char_ssid, 32);
| ^~~~
TEST_FOR_MAIL:203:5: error: 'password' was not declared in this scope
203 | password.toCharArray(char_password, 64);
| ^~~~~~~~
TEST_FOR_MAIL:213:5: error: 'username' was not declared in this scope
213 | username.toCharArray(char_username, 32);
| ^~~~~~~~
TEST_FOR_MAIL:236:16: error: 'ssid' was not declared in this scope
236 | WiFi.begin(ssid, password);
| ^~~~
TEST_FOR_MAIL:236:22: error: 'password' was not declared in this scope
236 | WiFi.begin(ssid, password);
| ^~~~~~~~
/Users/Daniel/TEST_FOR_MAIL/TEST_FOR_MAIL.ino: In function 'bool isNewObjectDetected()':
TEST_FOR_MAIL:253:21: error: 'mesureDistance' was not declared in this scope
253 | double distance = mesureDistance();
| ^~~~~~~~~~~~~~
TEST_FOR_MAIL:282:23: error: 'min_time_before_next_ultrasonic' was not declared in this scope
282 | delayMicroseconds(min_time_before_next_ultrasonic);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TEST_FOR_MAIL:296:68: error: 'distance_change_to_detect' was not declared in this scope
296 | if (nbr_mesure == 100 || moyenne_distance > (distance_bottom + distance_change_to_detect) || moyenne_distance < (distance_bottom - distance_change_to_detect)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Daniel/TEST_FOR_MAIL/TEST_FOR_MAIL.ino: In function 'void ledInterrupt()':
TEST_FOR_MAIL:349:21: error: 'led_timer_max' was not declared in this scope
349 | led_cpt = led_cpt%led_timer_max;
| ^~~~~~~~~~~~~
exit status 1
'trigger' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

What is in the config.h file?

Looking at your error messages, you should start reading here:
https://www.arduino.cc/reference/en/language/variables/variable-scope-qualifiers/scope/