how to trigger coloured lights from recieved email

Hello, I am looking for some help to see if its possible to send a trigger to turn lights on or off.

I use this for lightning alerts where I recieve an email that tells me if we are on a green, yellow or red alert and white for all clear. The subject line of each email starts with Green Alert, Yellow Alert, Red Alert, All Clear

is it possible to use email subject line as the trigger which will then turn on the corresponding light?

Appreciate your assistance

Cheers
Lance

The subject is readable and you could use the value
It would be like this
<input type="hidden" name="subject" id=":42k" value="red">
this looks like a good place to learn
http://blog.magiksys.net/parsing-email-using-python-header

I recieve an email

You already got that part sorted out?