I found the below snippets on VirtIRL.
This configures all vCenter alarms to send an email:
Now you can create an alarm trigger to send an email when the monitored item changes from green to yellow as well. The default alarm action automatically creates the alert for yellow to red (above example).
To add other transitions (red to yellow, yellow to green) you can just change the -StartStatus and -EndStatus to the necessary values.
To see all Alarms configured to send to a certain email address along with triggers:
To remove all SendEmail AlarmActions for a particular email address: