feat(newsletters): newsletter schema + models + renderer (Wave 3, WordPress - partial)#57
Open
mpge wants to merge 1 commit into
Open
feat(newsletters): newsletter schema + models + renderer (Wave 3, WordPress - partial)#57mpge wants to merge 1 commit into
mpge wants to merge 1 commit into
Conversation
…es (Wave 3 partial)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wave 3 partial port of the newsletter engine to WordPress. Per the spec, WordPress is special-cased (WP options + WP-Cron + WP capabilities instead of the cross-framework settings table / cron tick / permission system).
Escalated\Activator::create_newsletter_tables()(wired intoactivate()+ the upgrade path)marketing_opt_out_atcolumn added toescalated_contacts(viaALTER TABLEif missing)includes/Models/Newsletter/(static$wpdbhelpers, same pattern as existing Models)includes/Services/Newsletter/NewsletterRenderer.php— Markdown → theme → click rewrite → pixel injectiontemplates/newsletter_themes/(default + branded)Architecture notes
escalated_newsletter_markdown_rendererWordPress filter (Parsedown, league/commonmark, etc.).ob_start()/ob_get_clean(). Hosts can override the themes dir via theescalated_newsletter_themes_dirfilter.home_url()so it works on subdir/subdomain WP installs.dbDelta(the WP convention) and gates theALTER TABLEon a column-existence check to make the upgrade idempotent.Out of scope / follow-ups
wp_schedule_event('escalated_every_minute', 'escalated_newsletters_dispatch')call)/escalated/n/o/{token}.gif,/c/{token},/u/{token},/v/{token})Reviewer notes
create_newsletter_tablesmethod is intentionallypublic static(notprivate) so it can be re-run from a migration command in the future without touching the activator's mainactivate()flow.