Format the email messages. Currently in gogs comments uses markdown. The email content contains the raw markdown comments.
Format the markdown to html in the notification e-mails.
Format the email messages. Currently in gogs comments uses markdown. The email content contains the raw markdown comments.
Format the markdown to html in the notification e-mails.
I'll implement markdown-to-HTML conversion for email notifications. The plan is to:
Add markdown rendering functionality to the email notification system
Use the existing Gogs markdown API endpoint (/api/v1/markdown) since it's already available
Integrate it into the EmailNotifier to automatically convert markdown content to HTML
Test with issue comment notifications
I'll keep you updated on the progress!
@fszontagh I'm starting work on this issue now!
I'll implement markdown-to-HTML conversion for email notifications. The plan is to:
1. Add markdown rendering functionality to the email notification system
2. Use the existing Gogs markdown API endpoint (`/api/v1/markdown`) since it's already available
3. Integrate it into the EmailNotifier to automatically convert markdown content to HTML
4. Test with issue comment notifications
I'll keep you updated on the progress!
@fszontagh I've successfully implemented markdown-to-HTML rendering for email notifications! 🎉
## Changes Made
1. **Markdown Rendering Integration**
- Added `renderMarkdown()` method that calls the Gogs API `/api/v1/markdown` endpoint
- Uses Node.js built-in `https` module (maintaining zero-dependency philosophy)
- Supports both standard markdown and GitHub Flavored Markdown (GFM) modes
2. **Repository Context Support**
- When repository context is provided, uses GFM mode which enables:
- Issue/PR reference links (e.g., `#123`)
- User mentions with proper linking
- Other repository-aware features
3. **Enhanced HTML Templates**
- Improved CSS styling for rendered content
- Proper formatting for code blocks, tables, blockquotes, lists
- GitHub-like styling for consistent appearance
4. **Fallback Mechanism**
- If Gogs API is unavailable or returns an error, falls back to plain text HTML
- Graceful error handling ensures emails are always sent
5. **Configuration**
- Uses `GOGS_SERVER_URL` and `GOGS_ACCESS_TOKEN` from `.env` file
- No additional configuration needed
## How It Works
The email notification system now:
1. Receives webhook with markdown content (issue body, comment body, etc.)
2. Calls the Gogs markdown API to render it to HTML
3. Wraps the HTML in a styled template
4. Sends the email with both plain text and HTML versions
## Testing
✅ Tested markdown rendering with sample content including:
- Headers, bold, italic text
- Code blocks with syntax highlighting
- Lists and links
- Blockquotes and mentions
- Successfully renders to properly formatted HTML
The changes have been committed and pushed to the repository. Email notifications will now display beautifully formatted HTML instead of raw markdown!
Commit: e344de4
The implementation is complete and ready for use! 🚀
All email notifications sent through the system will now automatically render markdown content to HTML. The feature is backwards compatible and requires no changes to existing email rules configuration.
If you'd like me to close this issue or if you need any adjustments to the implementation, please let me know!
The implementation is complete and ready for use! 🚀
All email notifications sent through the system will now automatically render markdown content to HTML. The feature is backwards compatible and requires no changes to existing email rules configuration.
If you'd like me to close this issue or if you need any adjustments to the implementation, please let me know!
Format the email messages. Currently in gogs comments uses markdown. The email content contains the raw markdown comments.
Format the markdown to html in the notification e-mails.
@fszontagh I'm starting work on this issue now!
I'll implement markdown-to-HTML conversion for email notifications. The plan is to:
/api/v1/markdown) since it's already availableI'll keep you updated on the progress!
@fszontagh I've successfully implemented markdown-to-HTML rendering for email notifications! 🎉
Changes Made
Markdown Rendering Integration
renderMarkdown()method that calls the Gogs API/api/v1/markdownendpointhttpsmodule (maintaining zero-dependency philosophy)Repository Context Support
#123)Enhanced HTML Templates
Fallback Mechanism
Configuration
GOGS_SERVER_URLandGOGS_ACCESS_TOKENfrom.envfileHow It Works
The email notification system now:
Testing
✅ Tested markdown rendering with sample content including:
The changes have been committed and pushed to the repository. Email notifications will now display beautifully formatted HTML instead of raw markdown!
Commit:
e344de4The implementation is complete and ready for use! 🚀
All email notifications sent through the system will now automatically render markdown content to HTML. The feature is backwards compatible and requires no changes to existing email rules configuration.
If you'd like me to close this issue or if you need any adjustments to the implementation, please let me know!