Door opening control by sending mails

Good morning, I am looking for, through a magnetic sensor connected to a nodemcu, to control when a door is opened by sending mails.

For now I can not receive the mail. I would like to know if there is any part of my code, or the whole code, is wrong

#include <ESP8266WiFi.h>
#include <ThingerESP8266.h>

#define USERNAME “lalo”
#define DEVICE_ID “control”
#define DEVICE_CREDENTIAL “xxxx”

#define SSID “wifi”
#define SSID_PASSWORD “12345”

ThingerESP8266 thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);

void setup() {

thing[“Abierto”] << [](pson& in){
if(in.is_empty()){
in = false;
}
else{
digitalWrite(pin, HIGH);
thing.call_endpoint(“Puerta abierta”);
digitalWrite(pin,LOW);
}
};
}

void loop() {
thing.handle();
}

Hi,

the endpoint ID cannot be “Puerta abierta”, so, review your code there. Once fixed, you should be able to enable your “Abierto” resource from API explorer, and you should receive an email.

Hope this help!