Question about WiFiManager

I've never done any wireless stuff with Arduino. I ran across this video:

which almost does what I want to do - it's a mailbox notifier that uses an ESP8266 to connect to the router, then in turn connect to IFTTT, which will send an SMS message telling me the mailman has been there.

But it's not exactly the same because whereas he goes from active mode to deep sleep and back, my circuit will run the battery power through a magnetic reed SPDT switch such that power is completely disconnected when the door is closed, and of course anything in ram is lost. So in my situation, the 8266 would power up, connect to the router, phone home, then go to sleep. But shortly after going to sleep, the mailman would close the door, and power to the entire circuit would be disconnected. There's no point in testing for an open door because if the door wasn't open, the 8266 wouldn't be on in the first place.

The issue is the use of WiFiManager to get the router SSID and password. After getting that info the first time, it presumably doesn't do it again. But where does it save that information? Does this work because 8266 never really powers down, or is there EEPROM in the 8266 where it is saved?

I'm showing his code below. I have to admit that I simply don't understand most of it. But in particular, can someone tell me where it says to skip asking for router info if it already has it? Or is that all in the library? And I guess the more basic question is whether some other library would be more appropriate for my situation since I could easily just define the router connection info in the sketch in the first place.

// IFTTT SMS Version of the Code
// All of the following includes are for WIFI
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <WiFiManager.h>         // https://github.com/tzapu/WiFiManager

// MQTT IOT Includes
#include <IFTTTWebhook.h>

const char* ifttt_key = "7hWCwDwmUGOrCCGdM_VGh";
const char* ifttt_event_name = "MailboxDelivered";

WiFiClientSecure client;

const char* host = "maker.ifttt.com";
// current fingerprint can be found on a *nix system with the following command
// echo | openssl s_client -connect maker.ifttt.com:443 |& openssl x509 -fingerprint -noout
const char fingerprint[] PROGMEM = "AA 75 CB 41 2E D5 F9 97 FF 5D A0 8B 7D AC 12 21 08 4B 00 8C";
const String url = String("/trigger/") + ifttt_event_name + "/with/key/" + ifttt_key;
const int httpsPort = 443;

// enable reading battery voltage
ADC_MODE(ADC_VCC);

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200); // Starts the serial communication

  // Connect to WiFi
  Serial.print("\n\nConnecting Wifi... ");
  WiFiManager wifiManager;
  // uncomment the next line to clear all saved settings
  //wifiManager.resetSettings();
  wifiManager.autoConnect("MailboxSensorSetup");

  // Connected
  Serial.print("My Wifi IP is: ");
  Serial.println(WiFi.localIP());

  // main code
  // trigger webhook
  Serial.println("connecting to IFTTT");
  Serial.print("connecting to ");
  Serial.println(host);
  client.setFingerprint(fingerprint);
  if (!client.connect(host, httpsPort)) {
    Serial.println("connection failed");
    return;
  }

  if (client.verify(fingerprint, host)) {
    Serial.println("certificate matches");
  } else {
    Serial.println("certificate doesn't match");
  }

  // for a trustfire 14500 I want to send myself a low battery warning @ just under 3.5 volts.
  Serial.print("Read VCC: ");
  Serial.println(ESP.getVcc());

  client.print(String("POST ") + url + " HTTP/1.1\r\n" +
             "Host: " + host + "\r\n" +
             "User-Agent: ESP8266Mailbox\r\n" +
             "Connection: close\r\n\r\n");

  Serial.println("request sent");
  while (client.connected()) {
    String line = client.readStringUntil('\n');
    if (line == "\r") {
      Serial.println("headers received");
      break;
    }
  }
  String line = client.readStringUntil('\n');
  if (line.startsWith("{\"state\":\"success\"")) {
    Serial.println("esp8266/Arduino CI successfull!");
  } else {
    Serial.println("esp8266/Arduino CI has failed");
  }
  Serial.println("reply was:");
  Serial.println("==========");
  Serial.println(line);
  Serial.println("==========");
  Serial.println("closing connection");
  
  Serial.println("Triggered event, going to sleep");
  //deep sleep until reset
  ESP.deepSleep(0);  
}

void loop() {
}

the underlying esp8266 SDK saves the SSID and pasword to a dedicated area in flash memory

Ok, thanks. But it may not matter. A friend tells me my expectations for the time it takes to complete the phoning home process are unrealistic, and the mailman may on occasion shut the door, and thus turn off the power, while the process is still going on. So my idea of running the battery power through the switch may not be practical.

ShermanP:
and the mailman may on occasion shut the door, and thus turn off the power, while the process is still going on. So my idea of running the battery power through the switch may not be practical.

It shouldn't take you to much extra circuitry to keep power on for a few minutes (a 555 timer would do the trick, you can even use one of the GPIO pins to switch the 555 timer off, after the task is completed. Still using deepsleep may be more energy efficient depends how often the mailman comes.