Overview
The comment element allows you to include comments in your Elemental structure that won’t be rendered in the final output. This is useful for documenting your templates, adding notes for team members, or organizing complex Elemental structures. When to use:- Document complex template logic
- Add notes for other developers
- Organize and label sections of your template
- Include metadata that shouldn’t appear in notifications
Comments are completely ignored during rendering and will never appear in the final notification output, regardless of channel.
Basic Example
Fields
The type of element. For comment elements, this value must be
"comment".The comment text. This is the documentation or note you want to include. It will not be rendered in the final output.
An optional object that can be included with the comment. Useful for storing metadata, structured notes, or additional context that won’t be rendered.
Examples & Variants
Simple Comment
Add a basic text comment:Comment with Metadata
Include structured data with your comment:Organizing Template Sections
Use comments to organize and label different sections:Documenting Conditional Logic
Document complex conditional logic:Use Cases
Template Documentation
Document the purpose and structure of your templates for team members:A/B Testing Metadata
Store test variant information:Development Notes
Add notes during development:Best Practices
- Use descriptive comments: Make comments clear and helpful for future developers
- Organize sections: Use comments to visually separate different parts of your template
- Document complex logic: Explain why certain conditionals or logic exist
- Include metadata: Use the
objectfield to store structured information about the template
Related Elements
- Group Element - For organizing elements together
- Control Flow - For conditional rendering logic
- Elemental Overview - For understanding Elemental structure