'Registers emails with an identity server.
Used only by c/s api v1'

@defer.inlineCallbacks
def register_email(self, threepidCreds):

    for c in threepidCreds:
        logger.info('validating    theeepidcred    sid    %s    on    id    server    %s', c['sid'], c['idServer'])
        try:
            identity_handler = self.hs.get_handlers().identity_handler
            threepid = (yield identity_handler.threepid_from_creds(c))
        except:
            logger.exception("Couldn't    validate    3pid")
            raise RegistrationError(400, "Couldn't    validate    3pid")
        if (not threepid):
            raise RegistrationError(400, "Couldn't    validate    3pid")
        logger.info("got    threepid    with    medium    '%s'    and    address    '%s'", threepid['medium'], threepid['address'])
