Skip to content

Add comprehensive mailer delegation system with AWS SES support#23

Merged
ddon merged 7 commits into
BeamLabEU:mainfrom
timujinne:dev
Sep 11, 2025
Merged

Add comprehensive mailer delegation system with AWS SES support#23
ddon merged 7 commits into
BeamLabEU:mainfrom
timujinne:dev

Conversation

@timujinne
Copy link
Copy Markdown
Contributor

Summary

• Add mailer delegation support with automatic parent application mailer detection
• Add comprehensive AWS SES configuration with automatic Finch HTTP client setup
• Add production-ready email templates for SMTP, SendGrid, Mailgun, and AWS SES
• Update mailer architecture to support both delegation and built-in modes
• Update documentation with detailed provider-specific setup guides

Key Features

Mailer Delegation System:

  • Automatically detects existing MyApp.Mailer or MyAppWeb.Mailer modules
  • Seamless integration with parent application's email configuration
  • Backward compatibility with built-in PhoenixKit mailer

AWS SES Integration:

  • Complete setup automation with dependency management
  • Automatic Finch HTTP client configuration
  • Step-by-step production checklist with regional support
  • Auto-detection and installation of gen_smtp dependency

Enhanced Configuration:

  • Configurable sender email (from_email) and name (from_name)
  • Production templates for major email providers
  • Comprehensive documentation for each provider

Test Plan

  • Verify mailer delegation detection works with existing applications
  • Test AWS SES configuration with automatic Finch setup
  • Validate email sending through delegated mailers
  • Confirm backward compatibility with existing installations
  • Test production email provider configurations
  • Verify documentation accuracy and completeness

ddon and others added 7 commits September 8, 2025 20:01
Added badge for current hex version
Badge format fix
… matching

Fix regex patterns that incorrectly matched paths containing phoenix_kit substring
Fix false positive detection of test_phoenix_kit_v1_web as valid PhoenixKit integration
Add specific patterns for exact PhoenixKit dependency paths only
Update version to 1.2.3 with comprehensive changelog entry
EU and EE flags added
Fix trailing whitespace issues across multiple files
Fix unused alias imports in tasks and modules
Fix dialyzer warnings by updating ignore patterns
Add hybrid repository detection with fallback strategies
Add comprehensive status diagnostics and error reporting
Add application startup management for status command
Update status task to use simplified asset rebuild logic
Update assets rebuild to recommend rebuild consistently
Update phoenix_kit.update to delegate status display to status task
Remove complex asset checking logic in favor of simple approach
Add hex version badge to README
Update README footer with location information
Add comprehensive AWS SES configuration with Finch integration
Add email provider templates for production setup
Update mailer architecture to support delegation and built-in modes
Update documentation with detailed email configuration guides
Fix email sender configuration with configurable from_email settings
@ddon ddon merged commit 4389ea5 into BeamLabEU:main Sep 11, 2025
ddon pushed a commit that referenced this pull request Nov 12, 2025
…-checks-011CV2Tg5uDwND8MbUNbXG4B

Add centralized ensure_active_user function to reduce code duplication
ddon pushed a commit that referenced this pull request May 12, 2026
Code (PR #537 review items addressed):

- #1 BUG-MEDIUM: wrap `Annotations.delete/1` in `Repo.transaction/1` so
  comment-cascade + annotation-delete are atomic. Extracted into
  `delete_in_transaction/1` to keep the body flat (credo depth).
- #2 BUG-MEDIUM: sweep stale `resource_type = "annotation"` claims
  across 3 moduledocs (annotation.ex, v115.ex, etcher_adapter.ex). The
  implementation anchors comments to the file with
  `metadata.annotation_uuid` — docs now match reality.
- #5 BUG-LOW: narrow `delete_linked_comments` rescue to expected
  exception classes ([DBConnection.OwnershipError, Postgrex.Error,
  ArgumentError]) so logic bugs surface instead of being swallowed.
- #11 IMPROVEMENT-LOW: drop `normalize/1` — `Ecto.Changeset.cast/3`
  handles both atom- and string-keyed maps natively; the helper added
  silent failure-mode risk on typo'd keys.
- #12 IMPROVEMENT-LOW: drop in-repo `Code.ensure_loaded?(PhoenixKit.Annotations)`
  guard in MediaBrowser — Annotations is a core module, can't be
  missing.
- #19 NITPICK: drop `PhoenixKit.Modules.Storage` from
  AnnotationComposer's `@compile no_warn_undefined` (it's core, not
  optional — rename should fail loudly).
- #20 NITPICK: simplify `AnnotationComposerPosition.destroyed` guard.
- #21 NITPICK: fix misleading "Etcher's bootstrap uses `||` to preserve
  pre-existing slots" comment — PhoenixKit's JS owns the slots.
- #8 IMPROVEMENT-MEDIUM: gettext-wrap ~17 user-facing strings in
  AnnotationComposer (flash messages + heex literals + ARIA labels).

Credo / dialyzer:
- Alias `PhoenixKit.Annotations`, `PhoenixKit.Modules.Storage`,
  `PhoenixKit.Modules.Storage.EtcherAdapter`, `Storage.File` so the
  six "nested modules could be aliased" findings clear.
- Convert `first_attachment_thumbnail/1`'s single-clause `with` to
  `case` (credo readability).
- Add PhoenixKitComments-targeted entries to .dialyzer_ignore.exs for
  the annotations context + composer (optional sibling package,
  guarded at runtime).
- mix.lock picks up `etcher 0.1.0` via deps.get.

mix precommit: compile → format → credo --strict → dialyzer all clean.
Deferred to original author (Alex): #3 (race), #4 (upload rollback),
#6 (authz), #7 (schema-as-source), #9 (geometry validation), #10
(configurable component id), #13/#14 (locale-aware date + traverse_errors),
plus cosmetics #15-18, #22, #23. Disposition table in CLAUDE_REVIEW.md
updated separately.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ddon pushed a commit that referenced this pull request May 12, 2026
Code (4 more PR #537 review items):

- #7 IMPROVEMENT-MEDIUM: `Annotation.adapter_writable_fields/0` exposes
  the schema's `@cast_fields` (minus `file_uuid`, which the adapter
  sets server-side). EtcherAdapter derives `@schema_keys` from it so a
  future schema field can't drift from the adapter whitelist silently.
- #13 IMPROVEMENT-LOW: gettext-wrap the strftime format string in
  `format_date` (`gettext("%b %d, %Y")`) so locales can reorder date
  components (e.g. "%d %b %Y" for en-GB / fr / de).
- #14 IMPROVEMENT-LOW: route `AnnotationComposer.first_error/1` through
  `PhoenixKitWeb.Components.Core.Input.translate_error/1` — gettext-aware
  helper used elsewhere in the codebase that interpolates `%{count}` and
  other opts properly.
- #23 NITPICK: docstring on `truncate/2` clarifying that `limit` is the
  output length (incl. ellipsis), not the source length.

Docs:
- CLAUDE_REVIEW.md disposition table updated: 13 items addressed across
  `b45a7a93` + this commit, 9 deferred to Alex (down from 10 — #7 took).

mix precommit: compile → format → credo --strict (0 findings) →
dialyzer (160 errors all skipped) clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants