code: def send_result_email(self, sender=None):
      
      status = 'successful'
      if self.was_aborted:
        status = 'aborted'
  
      app_id = os.environ['APPLICATION_ID']
      shard_index = app_id.find('~')
      if shard_index != -1:
        app_id = app_id[shard_index+1:]
  
      param_dict = {
          'status': status,
          'app_id': app_id,
          'class_path': self._class_path,
          'pipeline_id': self.root_pipeline_id,
          'base_path': '%s.appspot.com%s' % (app_id, self.base_path),
      }
      subject = (
          'Pipeline %(status)s: App "%(app_id)s", %(class_path)s'
          '#%(pipeline_id)s' % param_dict)
      body = """View the pipeline results here:
  
  http://%(base_path)s/status?root=%(pipeline_id)s
  
  Thanks,
  
  The Pipeline API
  """ % param_dict
  
      html = """<html><body>
  <p>View the pipeline results here:</p>
  
  <p><a href="http://%(base_path)s/status?root=%(pipeline_id)s"
  >http://%(base_path)s/status?root=%(pipeline_id)s</a></p>
  
  <p>
  Thanks,
  <br>
  The Pipeline API
  </p>
  </body></html>
  """ % param_dict
  
      if sender is None:
        sender = '%s@%s.appspotmail.com' % (app_id, app_id)
      try:
        self._send_mail(sender, subject, body, html=html)
      except (mail.InvalidSenderError, mail.InvalidEmailError):
        logging.warning('Could not send result email for '
                        'root pipeline ID "%s" from sender "%s"',
                        self.root_pipeline_id, sender)
docs: Sends an email to admins indicating this Pipeline has completed.
  
      For developer convenience. Automatically called from finalized for root
      Pipelines that do not override the default action.
  
      Args:
        sender: (optional) Override the sender's email address.