
Editorial illustration.
Originally published 16 June 2023; rewritten and reviewed on 15 October 2026.
A useful snippet saves time because it captures a small piece of knowledge. It becomes difficult to maintain when the surrounding assumptions disappear. The Kentico collection in my original post covered email templates, calendar links, paging, logging and asynchronous work; each belongs to a different application boundary.
Keep template resolution within a known context
For an email helper, identify the site, template code name, recipient policy and macro data explicitly. Encode untrusted values according to their output context and keep delivery failures observable. A helper returning true should not conceal that a message only entered a queue.
Check every CMS API against the installed version. A copied method name is not evidence that a newer release resolves templates or sends mail the same way.
Treat calendar links as structured data
An “add to calendar” link needs a title, times, time zone and description encoded for its destination. Use real event values and verify the result in the intended calendar service. A demonstration URL with a historical date should not quietly become the production button.
Paging expressions likewise need a defined contract: which page is current, how empty results behave and whether numbering is zero- or one-based. Test the first and final pages rather than copying a display expression alone.
Keep observability and request context deliberate
The original collection showed suppressing selected CMS event logging around an operation. That deserves a narrowly justified scope, not a general response to noisy logs. Preserve the audit and failure evidence the operation requires.
It also described null URL context during asynchronous work. I would first capture the necessary site, culture and record identifiers before handing work to a background process. Forcing a global view mode is not a universal repair for missing request context.
The most reusable snippet includes its product version, inputs, result and limits. That small amount of explanation is what keeps a time-saving copy from becoming an unexplained dependency in the next project.