- What Laravel and Mailcoach versions does this package support?
- This package works with Mailcoach v6+ and Laravel 8.x or higher. MJML autocompletion is only available in Mailcoach v7+. Ensure your Laravel version is compatible with Mailcoach’s requirements, as older versions may need polyfills or adjustments.
- How do I install and configure this package?
- Run `composer require spatie/laravel-mailcoach-codemirror`, publish the package’s assets if needed, and update Mailcoach’s editor blade template to use CodeMirror. Configuration options like themes or plugins can be set in `config/mailcoach.php` or a custom config file.
- Does this package replace Mailcoach’s default editor entirely?
- Yes, it replaces the default editor with CodeMirror. If CodeMirror fails to load, Mailcoach should degrade gracefully to its original editor, though this behavior depends on how you implement the fallback in your blade template.
- Can I customize CodeMirror’s appearance or add plugins?
- Yes, you can extend CodeMirror’s configuration by modifying the package’s settings in your `config/mailcoach.php` or by overriding the published assets. This includes themes, line numbers, or additional plugins like linting or fold code.
- Is MJML autocompletion guaranteed to work in Mailcoach v6?
- No, MJML autocompletion is only supported in Mailcoach v7+. If you’re using v6, you’ll still get CodeMirror’s core features (syntax highlighting, editing) but won’t have MJML-specific autocompletion or validation.
- What frontend build tools does this package require?
- CodeMirror’s assets must be bundled via Mailcoach’s frontend pipeline, such as Laravel Mix or Vite. Ensure your build tooling supports external scripts and CSS, as CodeMirror adds ~100KB of assets that may impact initial load time.
- Are there any known conflicts with Mailcoach’s existing frontend stack?
- Potential conflicts may arise if CodeMirror’s CSS/JS clashes with Mailcoach’s existing styles or scripts. Proper namespacing and testing in a staging environment can mitigate this. If using Vue/React, ensure CodeMirror’s initialization doesn’t interfere with component lifecycle.
- How do I test this package in my Mailcoach setup?
- Run `composer test` to verify the package’s core functionality, then manually test CodeMirror’s integration in Mailcoach by editing templates and checking for JS errors. For MJML autocompletion, test with Mailcoach v7+ templates to ensure the feature works end-to-end.
- What happens if I need to roll back or disable this package?
- Since this is an optional add-on, you can easily disable it by removing the package and reverting your blade template to use Mailcoach’s default editor. Use feature flags during rollout to simplify rollback if issues arise.
- Is this package actively maintained? Should I fork it?
- The package appears abandoned (no recent updates or stars), so long-term support is uncertain. If you rely on it, consider forking it to apply fixes or updates internally. Check the GitHub repo for open issues or community forks before proceeding.