put your circuit and code... you may not get 100% same answer you want. you have to read and extract the information required for your project... and gsm project will have send sms routing in the forum,.,. you put your condition check and use that routine in your program.... you cant expect any website to give 100% answer as everyone has different requirements........
More over circuit does not matter as for modem you will not use anything more than serial UART, and for circuit to triggered is connected to a port pin.. so when circuit is triggered the port pin status would change and would send a pre- defined text message to a stored number...