Problem/Motivation
You get various exceptions if you try to use the module without having configured the MJML API credentials.
Steps to reproduce
Install the module and don't configure it.
Browse to /mjml_preview/render/42
Proposed resolution
If the API credentials are not configured yet we could:
- Hide the local tasks
- Return a correct HTTP code on the download and preview routes (404?)
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | mjml_preview-3564190.patch | 1.89 KB | shank115 |
Issue fork mjml_preview-3564190
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
shubham_pareek_19 commentedI was able to reproduce this locally. When the module is enabled and a valid node ID is used (for example /mjml_preview/render/1), the route is resolved correctly, but if the MJML API credentials are not configured yet, the request results in “The website encountered an unexpected error.”
This is not a 404 or routing issue—the controller is reached and fails due to missing configuration. Handling this case more gracefully (for example by hiding local tasks or returning a clean response when MJML is not configured) would improve the user experience on fresh installs.
please update issue summary.
Comment #3
shank115 commentedThis patch hides MJML Preview and Download tabs until MJML is configured.
Comment #5
prudloff commented