feat: add conversational style emails for some notifications#1886
Draft
feat: add conversational style emails for some notifications#1886
Conversation
84b2b78 to
3559686
Compare
- Add new conversational HTML template without Vikunja logo - Use GitHub color palette (#f6f8fa, #0969da, #24292f, #d1d9e0) - Implement system fonts (-apple-system, BlinkMacSystemFont) - Set max-width 700px with proper padding - Add inline action links with arrow (→) instead of buttons - Include proper footer styling with conditional borders - Maintain backward compatibility with existing formal template
- Add Conversational() method to Mail struct for template selection
- Add IsConversational() method for testing conversational flag
- Implement CreateConversationalHeader() for GitHub-style header lines
- Header format: {Username} {action} ({Project} > {Task})
- Use GitHub blue color (#0969da) for task links
- Add proper margin and styling for conversational headers
- Add tests for conversational flag functionality - Test template selection logic (conversational vs formal) - Verify GitHub-style header line format and styling - Test action link font size consistency (14px) - Add translation system integration tests - Ensure backward compatibility with existing formal emails - Test footer rendering and action link styling
- Add GetAvatarURL() method to User model - Support configurable avatar sizes with 20px default for emails - Use ServicePublicURL config for full avatar URLs - Fallback to relative URLs when public URL not configured - Prepare foundation for avatar integration in email headers
- Add action translation keys for conversational notifications - Include keys for comments, mentions, and assignments - Add fallback translation for project names - Support parameterized translations for assigned user names - Prepare for full internationalization of conversational emails Translation keys added: - notifications.common.actions.left_comment - notifications.common.actions.mentioned_you_comment - notifications.common.actions.mentioned_you - notifications.common.actions.mentioned_you_new_task - notifications.common.actions.assigned_you - notifications.common.actions.assigned_themselves - notifications.common.actions.assigned_user - notifications.common.fallbacks.project
- Update TaskCommentNotification to use conversational template - Update TaskAssignedNotification for all assignment scenarios - Update UserMentionedInTaskNotification for mentions and new tasks - Replace hard-coded strings with i18n translation keys - Add project title fetching with translated fallbacks - Generate GitHub-style header lines for all interactive notifications - Maintain formal style for system notifications (unchanged) Interactive notifications now use: - Conversational email template (no logo, GitHub styling) - Translated action descriptions - Project context in header lines - Consistent 14px font sizing
- Document GitHub-inspired design requirements - Specify dual template system (formal vs conversational) - Define color palette and typography standards - Outline notification categorization (interactive vs system) - Include implementation guidelines and examples - Provide visual comparison between email styles
- Add Project field to TaskCommentNotification, TaskAssignedNotification, and UserMentionedInTaskNotification structs - Populate Project when creating notifications in listeners - Remove project fetching from ToMail methods - Remove unused fallback translation key - Remove unused db import from notifications.go
- Remove extra blank lines in mail.go (gofmt) - Use require.NoError instead of assert.NoError in mail_test.go (testifylint)
The TaskCommentNotification now requires a Project field for conversational email headers. Add project lookup in test setup to prevent nil pointer dereference.
3559686 to
acb1af2
Compare
Preview DeploymentPreview deployments for this PR are available at:
The preview environment will start automatically on first visit. Subsequent pushes to this PR will update the Run locally with Dockerdocker pull ghcr.io/go-vikunja/vikunja:pr-1886
docker run -p 3456:3456 ghcr.io/go-vikunja/vikunja:pr-1886Last updated for commit acb1af2 |
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.
No description provided.