MKR NB 1500 send SMS when gate is opened

Hi, I am wondering if there is a possible way, that when a gate is opened (via a magnetic switch), it will send an SMS to a selected phone number? ( e.g. Smiths Lane gate opened at 6:22 PM) I am already using the Arduino MKR NB 1500, and have been successful in getting it to send an SMS, so am wondering if this next phase will work.
ANY help is amazing!!
TIA, Isaac

All perfectly possible

You will need a source of the time for which an RTC would be ideal. Detecting the opening or closing of a switch contact is easy as it causing something to happen as a result

How will the system be powered ?

It is getting powered by Solar, with a battery linked aswel. Wondering how easy and how to actually get it ti send an SMS when opened?

If you have managed to send an SMS as you say then getting it to do so when a switch contact is open or closed is simple. Slightly more complicated but still easy is to send an SMS when a switch contact becomes open or closed which is what you need to do

There are examples of reading the state of a switch in the IDE and an example of detecting the change of state of an input in the StateChangeDetection example

Thanks, will try this!