Correctly generate URL for emails

Related to owncloud/core#11500
Depeneds on owncloud/core#11534