Set the conditions in the script with an IF and in every reload it will be evaluated.
In this video you can see an example, you only have to change the url to the endpoint of your mail service API or use any integration tool like Zapier, IFTTT or Workato.