Answer
Build the target URL as a string inside a Custom Attribute on the Custom Event, concatenating the environment's base web-client URL with the page path and a $filter expression referencing the record's own key value from the triggering record — then reference that Custom Attribute directly in the email body text, rather than trying to construct the link inline in the email template itself.