Skip to content

Document preview PDF generation events for Emails and Landing Pages#508

Open
promptless-for-oss wants to merge 6 commits into
mautic:7.0from
Promptless:promptless/pr-16187-pdf-preview-events
Open

Document preview PDF generation events for Emails and Landing Pages#508
promptless-for-oss wants to merge 6 commits into
mautic:7.0from
Promptless:promptless/pr-16187-pdf-preview-events

Conversation

@promptless-for-oss
Copy link
Copy Markdown
Contributor

Open this suggestion in Promptless to view citations and reasoning process

Adds developer documentation for the new event-driven PDF generation feature introduced in mautic/mautic#16187. Documents the EMAIL_PREVIEW_GENERATE_PDF and PAGE_PREVIEW_GENERATE_PDF events, including event payload, methods, and code examples showing how plugins can provide custom PDF renderers.

Trigger Events


Tip: Attach PDFs in Slack messages to Promptless—it can even extract images from them 📎

Add developer documentation for the new event-driven PDF generation
feature that allows plugins and distributions to provide custom PDF
renderers for Email and Landing Page preview downloads.

Documents:
- EMAIL_PREVIEW_GENERATE_PDF event in EmailBundle
- PAGE_PREVIEW_GENERATE_PDF event in PageBundle
- Event payload, methods, and usage examples

Related to mautic/mautic#16187
This section is in progress. See ``\Mautic\EmailBundle\Stats\Helper\StatHelperInterface``

Preview PDF generation
----------------------
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Event details, class names (EmailPreviewPdfGenerationEvent, EmailEvents::EMAIL_PREVIEW_GENERATE_PDF), and default subscriber priority (-255) from the PR's new EmailBundle/Event/EmailPreviewPdfGenerationEvent.php and EmailBundle/EventListener/EmailPreviewPdfSubscriber.php files.

Source: mautic/mautic#16187

}

Preview PDF generation
**********************
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Event details, class names (PagePreviewPdfGenerationEvent, PageEvents::PAGE_PREVIEW_GENERATE_PDF), and default subscriber priority (-255) from the PR's new PageBundle/Event/PagePreviewPdfGenerationEvent.php and PageBundle/EventListener/PagePreviewPdfSubscriber.php files.

Source: mautic/mautic#16187

…F preview events

Incorporates additional details from the PR author's proposal:
- Default subscriber and generator class names
- Route paths for email and page preview PDF downloads
- Behavior note when no listener sets PDF content (500 error)
- Simplified note about priority override
Copy link
Copy Markdown
Contributor

@adiati98 adiati98 left a comment

Choose a reason for hiding this comment

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

@promptless-for-oss please address the suggestions

Comment thread docs/plugin_extensions/emails.rst
Comment thread docs/plugin_extensions/emails.rst Outdated
Comment thread docs/plugin_extensions/emails.rst Outdated
Comment thread docs/plugin_extensions/emails.rst Outdated
Comment thread docs/plugin_extensions/emails.rst Outdated
Comment thread docs/plugin_extensions/landing_pages.rst Outdated
Comment thread docs/plugin_extensions/landing_pages.rst Outdated
Comment thread docs/plugin_extensions/landing_pages.rst Outdated
Comment thread docs/plugin_extensions/landing_pages.rst Outdated
Comment thread docs/plugin_extensions/landing_pages.rst
- Add Vale directives around headings to suppress warnings
- Capitalize Plugins and User per Mautic style guide
- Replace renderers with generators for clarity
- Convert numbered lists to #. format per RST style
- Replace check with verify in method descriptions
- Fix capitalization in payload method descriptions
@promptless-for-oss
Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review @adiati98! I've addressed all your suggestions:

Applied across both emails.rst and landing_pages.rst:

  • Added .. vale off / .. vale on directives around "Preview PDF generation" and "Custom PDF generator example" headings
  • Capitalized "Plugins" and "User" per Mautic style guide
  • Replaced "renderers" with "generators" for clarity
  • Changed numbered lists from 1. 2. 3. 4. to #. format per RST style guide
  • Replaced "check" with "verify" in hasPdfContent() method descriptions
  • Fixed capitalization in payload method descriptions

Ready for another look when you have a chance.

Comment thread docs/plugin_extensions/landing_pages.rst Outdated
Addresses PR review feedback from @adiati98 to clarify that getPage()
returns the Landing Page entity specifically.
@promptless-for-oss
Copy link
Copy Markdown
Contributor Author

Done! Updated getPage() description to "The Landing Page entity" as suggested.

@adiati98 adiati98 added this to the 7.2 milestone May 31, 2026
Copy link
Copy Markdown
Contributor

@adiati98 adiati98 left a comment

Choose a reason for hiding this comment

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

@promptless-for-oss please address the suggestions

Comment thread docs/plugin_extensions/emails.rst
Comment thread docs/plugin_extensions/landing_pages.rst
Addresses PR review feedback: wraps the method bullet lists in
`.. vale off` / `.. vale on` directives to suppress Vale linting
on technical method descriptions.
@promptless-for-oss
Copy link
Copy Markdown
Contributor Author

Applied the suggested changes. Both method lists in the "Event payload" sections are now wrapped in .. vale off / .. vale on directives.

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