code: def notify(self, subsystem, recipient, subject, body_html, body_text):
          
          if not re.match(RGX_EMAIL_VALIDATION_PATTERN, recipient, re.I):
              raise ValueError('Invalid recipient provided')
  
          email = Email()
          email.timestamp = datetime.now()
          email.subsystem = subsystem
          email.sender = self.sender
          email.recipients = recipient
          email.subject = subject
          email.uuid = uuid.uuid4()
          email.message_html = body_html
          email.message_text = body_text
  
          method = dbconfig.get('method', NS_EMAIL, 'ses')
          try:
              if method == 'ses':
                  self.__send_ses_email([recipient], subject, body_html, body_text)
  
              elif method == 'smtp':
                  self.__send_smtp_email([recipient], subject, body_html, body_text)
  
              else:
                  raise ValueError('Invalid email method: {}'.format(method))
  
              db.session.add(email)
              db.session.commit()
          except Exception as ex:
              raise EmailSendError(ex)
docs: Method to send a notification. A plugin may use only part of the information, but all fields are required.
  
          Args:
              subsystem (`str`): Name of the subsystem originating the notification
              recipient (`str`): Recipient email address
              subject (`str`): Subject / title of the notification
              body_html (`str)`: HTML formatted version of the message
              body_text (`str`): Text formatted version of the message
  
          Returns:
              `None`