Skip to content

ansari-project/ansari-email-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Ansari Email Builder

Ansari Email Builder

Visual Interface for Creating Ansari Newsletters

A user-friendly Streamlit application for building professional newsletters without technical knowledge

πŸš€ Features

πŸ“ Visual Form Builder

  • Intuitive Interface: Edit newsletter content through user-friendly forms
  • Real-time Preview: See changes instantly in a live HTML preview
  • No Code Required: Perfect for team members without technical background

πŸ“‘ Dynamic Section Types

  • πŸ“„ Text Content: Rich paragraphs with markdown support
  • ⭐ Feature Grid: Showcase features in organized cards
  • πŸ“± Platform Cards: Display app availability with custom icons
  • πŸ‘₯ Contributors: Highlight team members and contributors
  • πŸ’¬ Feedback/Contact: Dynamic contact methods and paragraphs

✨ Enhanced Features

  • Dynamic Content Management: Add, edit, and delete content within each section type
  • Flexible Paragraph System: Multiple customizable paragraphs in feedback and content sections
  • Dynamic Contact Methods: Customizable contact buttons with editable text and links
  • Markdown Support: Format text with bold, italic, and links
  • Export Options: Download HTML for distribution and YAML for configuration backup

πŸ› οΈ Installation & Setup

Prerequisites

  • Python 3.7 or higher
  • pip package manager

Dependencies

The application automatically checks and installs the following dependencies:

  • streamlit>=1.28.0 - Web application framework
  • PyYAML>=6.0 - YAML configuration parsing
  • Jinja2>=3.0 - HTML template engine
  • streamlit-ace>=0.1.1 - Advanced code editor component
  • streamlit-code-editor>=0.1.19 - Enhanced code editing features

Quick Start

  1. Clone the Repository

    git clone https://github.com/ansari-org/ansari-email-builder.git
    cd ansari-email-builder
  2. Install Dependencies

    pip install -r requirements.txt
  3. Run the Application

    python run.py

    Alternative: Run directly with Streamlit

    streamlit run "UI Builder.py"
  4. Open in Browser

    • Streamlit will automatically open your browser
    • Or manually go to http://localhost:8501

πŸ“– How to Use

1. Basic Information Tab

  • Configure newsletter title and greeting message
  • Set up branding with logo URL
  • All changes reflect immediately in the live preview

2. Highlights Tab

  • Add key highlights that appear at the top of newsletters
  • Use markdown formatting for emphasis
  • Dynamically add/edit/remove highlight items

3. Content Tab

  • Add Sections: Choose from multiple section types
  • Edit Content: Each section type has specialized editing interfaces
  • Manage Sections: Reorder, edit, or delete sections as needed

4. Preview Tab

  • Real-time HTML preview updates automatically
  • Export options for HTML and YAML formats
  • Download ready-to-send newsletters

5. YAML Builder Page (Advanced Users)

  • Direct YAML configuration editing with syntax highlighting
  • Advanced code editor with autocomplete and validation
  • Switch between visual UI and YAML editing modes
  • Export and import YAML configurations

πŸ“‹ Section Types Guide

πŸ“„ Text Content Sections

  • Multiple editable paragraphs
  • Full markdown support
  • Perfect for announcements and detailed descriptions

⭐ Feature Grid Sections

  • Add/edit/delete individual features
  • Each feature has title and description
  • Automatically organized in responsive grid layout

πŸ“± Platform Cards Sections

  • Showcase app availability across platforms
  • Custom icons and links for each platform
  • Professional card-based design

πŸ‘₯ Contributors Sections

  • Contributors List: Add/edit/delete individual contributors with names and descriptions
  • Additional Thanks: Multiple thank-you messages and acknowledgments
  • Section Description: Customizable introduction text

πŸ’¬ Feedback/Contact Sections

  • Dynamic Paragraphs: Multiple customizable paragraphs instead of fixed text
  • Contact Methods: Add/edit/delete contact buttons with custom text and links
  • Flexible Layout: Fully customizable contact information display

🎨 Customization

Markdown Support

  • **bold text** β†’ bold text
  • *italic text* β†’ italic text
  • [link text](URL) β†’ clickable links

Icon Integration

  • Built-in icon library with Google Drive hosted images
  • Custom icon support for platforms and sections
  • Consistent visual branding across all newsletters

πŸ—οΈ Technical Architecture

Core Components

  • Frontend: Streamlit for rapid prototyping and user interface
  • Templating: Jinja2 for consistent HTML generation
  • State Management: Streamlit session state for form persistence
  • Export System: YAML and HTML generation for multiple use cases

File Structure

ansari-email-builder/
β”œβ”€β”€ run.py                     # Main application runner with dependency checks
β”œβ”€β”€ UI Builder.py              # Primary Streamlit UI application
β”œβ”€β”€ requirements.txt           # Python dependencies
β”œβ”€β”€ pages/                     # Streamlit multi-page components
β”‚   └── YAML Builder.py       # YAML configuration editor
β”œβ”€β”€ utils/                     # Utility modules
β”‚   β”œβ”€β”€ newsletter_builder.py # Core newsletter building logic
β”‚   β”œβ”€β”€ test_builder.py       # Testing framework
β”‚   └── create_icon.py        # Icon generation utility
β”œβ”€β”€ assets/                    # Design assets and templates
β”‚   β”œβ”€β”€ email_template.jinja2  # HTML email template
β”‚   β”œβ”€β”€ email_icon.*          # Application icons (PNG, SVG, ICO)
β”‚   β”œβ”€β”€ compositeLogo.*       # Ansari branding assets
β”‚   └── *.svg, *.png         # Various UI icons and graphics
β”œβ”€β”€ secrets/                   # Private configuration and outputs
β”‚   └── *.html, *.md         # Generated newsletters and drafts
└── README.md                 # This documentation

πŸš€ Development

Application Architecture

The application follows a modular design:

  • run.py: Entry point that handles dependency checking, core functionality testing, and launches the Streamlit interface
  • UI Builder.py: Main Streamlit application with visual form builder
  • YAML Builder.py: Advanced YAML editor page for power users
  • utils/newsletter_builder.py: Core newsletter generation engine with template processing
  • assets/email_template.jinja2: HTML email template with dynamic section rendering

Adding New Section Types

  1. Update Section Selection in UI Builder.py

    section_type = st.selectbox("Section Type:",
        ["content", "features", "platforms", "contributors", "feedback", "your_new_type"])
  2. Create Section Template

    elif section_type == 'your_new_type':
        new_section.update({
            'field1': 'default_value',
            'field2': []
        })
  3. Add Editing Interface

    elif section['type'] == 'your_new_type':
        # Add form elements for editing
  4. Update HTML Template in assets/email_template.jinja2

    {% if section.type == 'your_new_type' %}
        <!-- Your HTML template -->
    {% endif %}

Running Tests

python utils/test_builder.py

Multi-Page Application

The application now supports multiple pages:

  • UI Builder: Visual form-based editor (main page)
  • YAML Builder: Advanced YAML configuration editor for power users

🀝 Contributing

We welcome contributions to improve the Ansari Email Builder! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“„ License

This project is part of the Ansari ecosystem. Please refer to the main Ansari project for licensing information.

πŸ”— Related Projects

πŸ†˜ Support

For questions, issues, or feature requests:

  • GitHub Issues: Use the Issues tab in this repository
  • Community: Join the Ansari community discussions
  • Documentation: Check the inline help within the application

πŸ† Acknowledgments

Built with ❀️ by the Ansari team to streamline newsletter creation and improve team collaboration.


Made with πŸš€ by the Ansari Team

About

A Visual Interface for Creating Ansari Newsletters

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published