def subscribe_to_sr(request_id, email):
    match = re.match('[A-Z0-9._%+\\-]+@[A-Z0-9.\\-]+\\.[A-Z]{2,4}$', email, re.IGNORECASE)
    if match:
        key = updater.subscribe(request_id, 'email', email)
        if key:
            session['addr'] = email
            session.permanent = True
            return True
        else:
            app.logger.error('Error creating a subscription for %s on %s', email, request_id)
    return False
def subscribe_to_sr(request_id, email):
    match = re.match('[A-Z0-9._%+\\-]+@[A-Z0-9.\\-]+\\.[A-Z]{2,4}$', email, re.IGNORECASE)
    if match:
        key = updater.subscribe(request_id, 'email', email)
        if key:
            session['addr'] = email
            session.permanent = True
            return True
        else:
            app.logger.error('Error creating a subscription for %s on %s', email, request_id)
    return False