input: Write a python function to define a set of rules to send emails.
  assert email_rule("data['name'] == 'John'")({'name': 'John'}) == True
  assert email_rule("data['age'] > 18")({'age': 20}) == True
  assert email_rule("data['email'].endswith('@example.com')")({'email': 'user@example.com'}) == True
  assert email_rule("data['name'] == 'Alice'")({'name': 'Bob'}) == False
output: def email_rule(rule):
      def rule_checker(data):
          return eval(rule)
      return rule_checker