'Sends a mail when the client has responded.'

@flow.StateHandler()
def SendMail(self, responses):

    if responses.success:
        client = aff4.FACTORY.Open(self.client_id, token=self.token)
        hostname = client.Get(client.Schema.HOSTNAME)
        url = urllib.urlencode((('c', self.client_id), ('main', 'HostInformation')))
        subject = ('GRR    Client    on    %s    became    available.' % hostname)
        email_alerts.EMAIL_ALERTER.SendEmail(self.args.email, 'grr-noreply', subject, (self.template % dict(client_id=self.client_id, admin_ui=config.CONFIG['AdminUI.url'], hostname=hostname, urn=url, creator=self.token.username, signature=config.CONFIG['Email.signature'])), is_html=True)
    else:
        flow.FlowError('Error    while    pinging    client.')
