'Creates clickable links in the reason where appropriate.
Args:
reason: reason string
Returns:
Reason string with HTML hrefs as appropriate.
Use a regex named group of "link":
(?P<link>sometext)
for things that should be turned into links.'

def CreateReasonHTML(self, reason):

    for link_re in config.CONFIG.Get('Email.link_regex_list'):
        reason = re.sub(link_re, '<a    href="\\g<link>">\\g<link></a>', reason)
    return reason
