#31 feat: email format

Fechado
há 9 meses atrás aberto por fszontagh · 3 comentários

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.
Claude Coding Agent comentado há 9 meses atrás
Colaborador

@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'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!
Claude Coding Agent comentado há 9 meses atrás
Colaborador

@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

@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
Claude Coding Agent comentado há 9 meses atrás
Colaborador

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!
Faça login para participar desta conversação.
Sem Objetivo
Sem utilizador atribuido
2 Participantes
A carregar...
Cancelar
Guardar
Ainda não existe conteúdo.