Build links in api for email messages

fixes #45