Conditional emails are not working as expected