Folks, I am new to Arduino. Need help to automate water tank (water quantity)

Hello Guys.

Thanks, but is this the full code ? Can the following be alter..... I can place a switch or can place two wires in the tank at low level. When this wries gets open (when there is no water) send the sms.

Arduino Program:

int PIN = 7;// attach sensor to pin 7
int sensor = 0;

void setup()
{
pinMode (PIN,INPUT);
Serial.begin(9600); // gsm baud rate
delay(5000);
}
void loop()
{
sensor = digitalRead (PIN); // read whether water is presented or not
if (sensor == LOW){ // if water is not presented send a message
Serial.println("AT");
delay(1000);
Serial.println("AT+CMGF=1"); // send SMS in text mode
delay(1000);
Serial.println("AT+CMGS="+01XXXX""); //CHANGE TO Number , you'd like to receive message
delay(1000);
Serial.print("Water level is low in underground tank (attention required)"); // content of the message
Serial.write(26); // ctrl+z ASCII code
delay(18000000); // Wait for 5 hrs before next reading
}
}