Hi,
As we discussed in the emails, unfortunately, there are no nice examples available.
You could try to run your code outside the email template - just try or even debug it anywhere else (e.g. in separate control or page).
As it's basically a K# context macro, you could try to get more details using
Macro debugCould you also please check the
Event log in Site manager -> Administration -> Event log for any errors related?
According to the discussion in the emails, we'll post more info or solution here later.
Regards,
Zdenek