code: def _send_email(name, email):
      "send a email to inform user of account creation"
      config = __salt__['config.option']('splunk')
      email_object = config.get('email')
      if email_object:
          cc = email_object.get('cc')
          subject = email_object.get('subject')
          message = email_object.get('message').format(name, name, _generate_password(email), name)
  
          try:
              mail_process = subprocess.Popen(['mail', '-s', subject, '-c', cc, email], stdin=subprocess.PIPE)
          except Exception as e:
              log.error("unable to send email to %s: %s", email, e)
  
          mail_process.communicate(message)
  
          log.info("sent account creation email to %s", emailf _send_email(name, email):
      "send a email to inform user of account creation"
      config = __salt__['config.option']('splunk')
      email_object = config.get('email')
      if email_object:
          cc = email_object.get('cc')
          subject = email_object.get('subject')
          message = email_object.get('message').format(name, name, _generate_password(email), name)
  
          try:
              mail_process = subprocess.Popen(['mail', '-s', subject, '-c', cc, email], stdin=subprocess.PIPE)
          except Exception as e:
              log.error("unable to send email to %s: %s", email, e)
  
          mail_process.communicate(message)
  
          log.info("sent account creation email to %s", email)
docs: send a email to inform user of account creation