Hi,
This is not built in functionality as JavaScript cannot send an email on it’s own. I think your easiest solution is to create a workflow that starts when a field is set to a certain value / changed, and then use a DFFS rule to set this field based on a condition.