Skip to content

[v1.0.0] Alpha to Stable Deployment#1

Merged
aaronginder merged 35 commits intomainfrom
alpha
May 25, 2025
Merged

[v1.0.0] Alpha to Stable Deployment#1
aaronginder merged 35 commits intomainfrom
alpha

Conversation

@aaronginder
Copy link
Copy Markdown
Owner

@aaronginder aaronginder commented Dec 25, 2024

Title

Release html email generator library


Description

What

This pull request releases the initial stable release of the html email generator library built in Python. Users are able to use this library to generate HTML files that can be embedded into emails to allow for a professional look to an email in an easy, yaml-config driven manner.

Why

Initial release.

How

  • Change python to python3.12 in tests and add package-lock.json (1a21f0d)

  • Clear changelog and remove tags (85480a4)

  • Remove example output from readme (9783a2b)

  • Add examples (6d581b0)

  • Add logging, error handling and clean up (4330061)

  • Add semantic release workflow (012745c)

  • Add library code for HTML generator class

Impact

  • No breaking changes.
  • Initial stable release

Testing

Unit Tests

  • Add unit tests and github actions workflow for tests (df792e7)
  • Update test workflow to use poetry to install Python dependencies (810c2d4)
  • Update test workflow to include test packer code (4aab2ec)
  • Add dependency between test and release workflow (8507d9e)

Integration Tests

None

Manual Testing

  • Tested locally and sent HTML emails using output file generated by this library

Checklist

  • Code changes
  • Added unit tests
  • Verified with local development
  • Updated documentation, if applicable
  • Screenshots or demos added (if applicable)

Additional Comments

None

@aaronginder aaronginder self-assigned this Dec 25, 2024
@aaronginder aaronginder added enhancement New feature or request documentation Improvements or additions to documentation labels Dec 25, 2024
semantic-release-bot and others added 11 commits December 26, 2024 17:50
# 1.0.0-alpha.1 (2024-12-26)

### Bug Fixes

* add dependency between test and release workflow ([8507d9e](8507d9e))
* change python to python3.12 in tests and add package-lock.json ([1a21f0d](1a21f0d))
* remove example output  from readme ([9783a2b](9783a2b))
* update test workflow to use poetry to install Python dependencies ([810c2d4](810c2d4))

### Features

* add examples ([6d581b0](6d581b0))
* add logging, error handling and clean up ([4330061](4330061))
* add semantic release workflow ([012745c](012745c))
* add unit tests ([92e2539](92e2539))
* Add unit tests and github actions workflow for tests ([df792e7](df792e7))
# 1.0.0-alpha.1 (2024-12-26)

### Bug Fixes

* add dependency between test and release workflow ([8507d9e](8507d9e))
* change python to python3.12 in tests and add package-lock.json ([1a21f0d](1a21f0d))
* remove example output  from readme ([9783a2b](9783a2b))
* update test workflow to include test packaer code ([4aab2ec](4aab2ec))
* update test workflow to use poetry to install Python dependencies ([810c2d4](810c2d4))

### Features

* add examples ([6d581b0](6d581b0))
* add logging, error handling and clean up ([4330061](4330061))
* add semantic release workflow ([012745c](012745c))
* add unit tests ([92e2539](92e2539))
* Add unit tests and github actions workflow for tests ([df792e7](df792e7))
# 1.0.0-alpha.1 (2024-12-26)

### Bug Fixes

* add dependency between test and release workflow ([8507d9e](8507d9e))
* change python to python3.12 in tests and add package-lock.json ([1a21f0d](1a21f0d))
* remove example output  from readme ([9783a2b](9783a2b))
* update test workflow to include test packaer code ([4aab2ec](4aab2ec))
* update test workflow to use poetry to install Python dependencies ([810c2d4](810c2d4))

### Features

* add examples ([6d581b0](6d581b0))
* add logging, error handling and clean up ([4330061](4330061))
* add semantic release workflow ([012745c](012745c))
* add unit tests ([92e2539](92e2539))
* Add unit tests and github actions workflow for tests ([df792e7](df792e7))
# 1.0.0-alpha.1 (2024-12-26)

### Bug Fixes

* add dependency between test and release workflow ([8507d9e](8507d9e))
* change python to python3.12 in tests and add package-lock.json ([1a21f0d](1a21f0d))
* remove example output  from readme ([9783a2b](9783a2b))
* update test workflow to include test packaer code ([4aab2ec](4aab2ec))
* update test workflow to use poetry to install Python dependencies ([810c2d4](810c2d4))

### Features

* add examples ([6d581b0](6d581b0))
* add logging, error handling and clean up ([4330061](4330061))
* add semantic release workflow ([012745c](012745c))
* add unit tests ([92e2539](92e2539))
* Add unit tests and github actions workflow for tests ([df792e7](df792e7))
# 1.0.0-alpha.1 (2024-12-26)

### Bug Fixes

* add dependency between test and release workflow ([8507d9e](8507d9e))
* change python to python3.12 in tests and add package-lock.json ([1a21f0d](1a21f0d))
* remove example output  from readme ([9783a2b](9783a2b))
* update test workflow to include test packaer code ([4aab2ec](4aab2ec))
* update test workflow to use poetry to install Python dependencies ([810c2d4](810c2d4))

### Features

* add examples ([6d581b0](6d581b0))
* add logging, error handling and clean up ([4330061](4330061))
* add semantic release workflow ([012745c](012745c))
* add unit tests ([92e2539](92e2539))
* Add unit tests and github actions workflow for tests ([df792e7](df792e7))
# 1.0.0-alpha.1 (2024-12-26)

### Bug Fixes

* add dependency between test and release workflow ([8507d9e](8507d9e))
* change python to python3.12 in tests and add package-lock.json ([1a21f0d](1a21f0d))
* clear changelog and remove tags ([85480a4](85480a4))
* remove example output  from readme ([9783a2b](9783a2b))
* update test workflow to include test packaer code ([4aab2ec](4aab2ec))
* update test workflow to use poetry to install Python dependencies ([810c2d4](810c2d4))

### Features

* add examples ([6d581b0](6d581b0))
* add logging, error handling and clean up ([4330061](4330061))
* add semantic release workflow ([012745c](012745c))
* add unit tests ([92e2539](92e2539))
* Add unit tests and github actions workflow for tests ([df792e7](df792e7))
@aaronginder aaronginder requested a review from Copilot May 25, 2025 22:02
@aaronginder aaronginder merged commit d8f0e7c into main May 25, 2025
1 of 2 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR delivers the initial stable release (v1.0.0) of the Python-based HTML email generator library, including core generation logic, tests, examples, and CI/CD setup.

  • Introduces EmailHTMLGenerator class with YAML-driven HTML/email generation and embedded Base64 images
  • Adds comprehensive unit tests and sample YAML configurations
  • Sets up CLI, documentation (README), and semantic-release workflows

Reviewed Changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
emailer/generator.py Core generator implementation with section- and image-builders
tests/unittests/test_email_html_generator.py Unit tests for config loading and HTML generation
emailer/cli.py CLI entrypoint for invoking the generator
samples/*.yaml Example configurations for various email templates
pyproject.toml Package metadata and dependency configuration
README.md User documentation and usage guide
.github/workflows/*.yaml CI tests and release workflows
RELEASE_NOTES.md Release notes for v1.0.0
Comments suppressed due to low confidence (3)

samples/functionality.yaml:8

  • Invalid section type "headers"—the generator expects "header". Update to match the supported types or enhance validation.
- type: "headers"

README.md:3

  • Filename typo in the image path: newletter_header.jpg should likely be newsletter_header.jpg to match the project name.
<img src="assets/newletter_header.jpg">

emailer/generator.py:175

  • There are no unit tests covering build_block_section or link/button rendering. Consider adding tests for block layouts and build_link_column to ensure coverage.
elif section_type == "block":

Comment thread emailer/generator.py
Comment on lines +89 to +90
<title>{title}</title>
<style>
Copy link

Copilot AI May 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HTML template string duplicates <title> and <style> tags (lines 88–91). Remove the extra <title> and redundant <style> to ensure valid head markup.

Suggested change
<title>{title}</title>
<style>

Copilot uses AI. Check for mistakes.
Comment thread emailer/generator.py
Comment on lines +320 to +321
button_height = column.get("styles", {}).get("button-height", "auto") # Default to 16px if not provided
button_height = column.get("styles", {}).get("background-button-color", "none")
Copy link

Copilot AI May 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next line overwrites button_height with background-button-color. This looks like a typo—use separate variables for height and background color or correct the key lookup.

Suggested change
button_height = column.get("styles", {}).get("button-height", "auto") # Default to 16px if not provided
button_height = column.get("styles", {}).get("background-button-color", "none")
button_height = column.get("styles", {}).get("button-height", "auto") # Default to "auto" if not provided
background_button_color = column.get("styles", {}).get("background-button-color", "none") # Default to "none" if not provided

Copilot uses AI. Check for mistakes.
Comment thread emailer/generator.py
str: The Content-ID (CID) for the image.
"""
cid = os.path.basename(image_path).replace(".", "_")
self.inline_images[cid] = image_path
Copy link

Copilot AI May 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline_images dictionary is never initialized in __init__. Add self.inline_images = {} before it's first used to avoid an AttributeError.

Copilot uses AI. Check for mistakes.
@mock.patch("builtins.open", new_callable=mock.mock_open)
def test_generate_html(mock_open, mock_exists, mock_yaml_file, mock_config):
"""Test generating HTML from the configuration."""
with mock.patch("main.utils.email_html_generator.EmailHTMLGenerator.load_config", return_value=mock_config):
Copy link

Copilot AI May 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import path for patching load_config is incorrect. The class lives in emailer.generator, so patch emailer.generator.EmailHTMLGenerator.load_config instead.

Suggested change
with mock.patch("main.utils.email_html_generator.EmailHTMLGenerator.load_config", return_value=mock_config):
with mock.patch("emailer.generator.EmailHTMLGenerator.load_config", return_value=mock_config):

Copilot uses AI. Check for mistakes.
# The template has the following sections:
# - Image header as a banner of the email
# - Details of who the email is from and for, and purpose
# - Paragarph of the details of the email, including any updates
Copy link

Copilot AI May 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in comment: "Paragarph" should be spelled "Paragraph".

Suggested change
# - Paragarph of the details of the email, including any updates
# - Paragraph of the details of the email, including any updates

Copilot uses AI. Check for mistakes.
# Professional Newsletter Template
# A template for creating a professional-looking newsletter. This template includes a header, an introductory paragraph, a main content section, and a footer with an image.

title: "Corporate Anouncement"
Copy link

Copilot AI May 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the title: "Anouncement" should be spelled "Announcement".

Suggested change
title: "Corporate Anouncement"
title: "Corporate Announcement"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants