8000 fix(messaging): fix template CRUD, start exporting plain text from EmailTemplater by havenbarnes · Pull Request #33634 · PostHog/posthog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(messaging): fix template CRUD, start exporting plain text from EmailTemplater #33634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 13, 2025

Conversation

havenbarnes
Copy link
Contributor
@havenbarnes havenbarnes commented Jun 12, 2025

Problem

A few things broke with message template CRUD/UX after some nav changes + liquid templating. This should fix all CRUD ops, plus a couple of other things:

  • We were requiring a "from" address on templates, but that's not really necessary
  • Our EmailTemplater component only exports the HTML version of the email, with no plaintext. It's not a hard requirement for modern email clients, and the consensus is this should not affect deliverability with it included or not, but we may as well.
Screenshot 2025-06-12 at 2 01 09 PM

Did you write or update any docs for this change?

How did you test this code?

Verified all things message templates end to end locally

Copy link
Contributor
@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Updates the email template system to simplify requirements and improve email format support. Major focus on template creation workflow and email content handling.

  • Removed mandatory 'from' address requirement in MessageTemplate.tsx and message_templates.py for more flexible template creation
  • Added plain text email content generation in emailTemplaterLogic.tsx alongside HTML for better email client compatibility
  • Changed template lifecycle hook from propsChanged to afterMount in messageTemplateLogic.ts for more reliable template loading
  • Updated NEW_TEMPLATE constant in constants.ts with proper Microsoft Office and mobile compatibility formatting

5 files reviewed, 1 comment
Edit PR Review Bot Settings | Greptile

Comment on lines 135 to 136
const htmlData = await new Promise<any>((res) => editor.exportHtml(res))
const textData = await new Promise<any>((res) => editor.exportPlainText(res))
Copy link
Contributor

Choose a reason for hiding this comment

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

style: consider wrapping these Promise calls in Promise.all() to execute them in parallel for better performance

Copy link
Contributor
github-actions bot commented Jun 12, 2025

Size Change: 0 B

Total Size: 1.83 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 1.83 MB

compressed-size-action

@havenbarnes havenbarnes merged commit fa6d3cd into master Jun 13, 2025
99 checks passed
@havenbarnes havenbarnes deleted the fix/message-template-creation branch June 13, 2025 22:05
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
0