A module allowing you to write your Processwire template using MJML and get a converted HTML output using MJML API.

Related tags

CMS PageMjmlToHtml
Overview

PageMjmlToHtml

A module allowing you to write your Processwire template using MJML and get a converted HTML output using MJML API.

This is considered to be in alpha and as such needs some testing before being used in production!

Capture d’écran 2021-12-02 à 19 05 54

Modules directory: https://processwire.com/modules/page-mjml-to-html/

Support forum: https://processwire.com/talk/topic/26466-pagemjmltohtml/

About

Created by Mailjet, MJML is a markup language making it a breeze to create newsletters displayed consistently across all email clients.

Write your template using MJML combined with Processwire’s API and this module will automatically convert your code into a working newsletter thanks to their free-to-use Rest API.

Prerequisite

For this module to work you will need to get an API key and paste it in the module’s configuration.

Usage

Once your credentials are validated, select the template(s) in which you’re using the MJML syntax, save and go visualize your pages to see if everything’s good. You will either get error/warning messages or your email properly formatted and ready-to-go.

From there you can copy/paste the raw generated code in an external mailing service or distribute your newsletter using ProMailer.

Features

  • The MJML output is cached to avoid repetitive API calls
    • Not cached if there are errors/warnings
    • Cleared if the page is saved
    • Cleared if the template file has been modified
  • A simple (dumb?) code viewer highlights lines with errors/warnings
  • A button is added to quickly copy the raw code of the generated newsletter
    • Not added if the page is rendered outside of a PageView
    • Only visible to users with the page’s edit permission
  • A shortcut is also added under “View” in the edit page to open the raw code in a new tab
  • Multi-languages support

Capture d’écran 2021-12-02 à 21 21 45

Notes

The code viewer is only shown to superusers. If there’s an error the page will display:

  • Only its title for guests
  • Its title and a message inviting to contact the administrator for editors

If you are using the markup regions output strategy, it might be best to not append files to preserve your MJML markup before calling the MJML API. This option is available in the module’s settings.

You might also like...
A template package of package development for Concrete CMS Version 9.

A boilerplate to develop a package on Concrete CMS Version 9.

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.

Jetpack Monorepo This is the Jetpack Monorepo. It contains source code for the Jetpack plugin, the Jetpack composer packages, and other things. How to

Html menu generator
Html menu generator

Html Menu Generator The spatie/menu package provides a fluent interface to build menus of any size in your php application. If you're building your ap

Module to generate a mega dropdown menu for YOOtheme Pro
Module to generate a mega dropdown menu for YOOtheme Pro

YOOtheme Mega Menu module Joomla module to generate a mega dropdown menu for YOOtheme Pro. Installation instructions Download the latest release here.

Charcoal Content Management System (CMS) Module

Charcoal CMS The CMS Charcoal Module (Content Management System). Provides basic objects to build a website. Notably, Section (or page), News, Event a

A Concrete CMS package to add interfaces to translate multilingual content. You can translate content manually, or use cloud API.

Concrete CMS add-on: Macareux Content Translator Concrete CMS has powerful features to manage multilingual content by its default. You can add languag

phpReel is a free, MIT open-source subscription-based video streaming service that lets you create your platform for distributing video content in the form of movies or series.

phpReel is a free, MIT open-source subscription-based video streaming service that lets you create your platform for distributing video content in the form of movies or series.

DaybydayCRM an open-source CRM, to help you keep track of your daily workflow.
DaybydayCRM an open-source CRM, to help you keep track of your daily workflow.

====================== DaybydayCRM is an everyday customer relationship management system (CRM) to help you keep track of your customers, tasks, appoi

BaiCloud-cms is a powerful open source CMS that allows you to create professional websites and scalable web applications. Visit the project website for more information.

BaiCloud-cms About BaiCloud-cms is a powerful open source CMS that allows you to create professional websites and scalable web applications. Visit the

Releases(1.1.4)
  • 1.1.4(Nov 21, 2022)

  • 1.1.3(Oct 12, 2022)

    This releases introduces two new options:

    • the ability to generate a unique output per GET variables, expect for ?raw which is used by the module
    • the ability to bypass the cache for specific roles. Useful in cases where the cache cleaning after a page save or an update to the template’s file is not enough

    A notice has been added regarding the TracyDebugger module, as it hooks as well after render and might add markup to the raw code. It is advised to disable the template using No debug bar in selected frontend templates in TracyDebugger’s setting

    Small fixes / cleaning have been made as well

    Source code(tar.gz)
    Source code(zip)
  • 1.1.2(Dec 15, 2021)

    This release fixes an issue when adding/removing a template in allowedTemplates. I basically forgot to update the name of the Inputfield... You might need to uninstall/reinstall the module.

    Source code(tar.gz)
    Source code(zip)
  • 1.1.1(Dec 10, 2021)

    Changed the js to be Promise-based. The code escapes early if Promises are not supported, resulting in the "raw code" link to just open a new tab.

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Dec 9, 2021)

    In this new version I introduced potentially breaking changes, though I mitigated them as much as I can.

    Changes are:

    • changed filename of css/js files to PageMjmlToHtml (instead of debug)
    • changed module configuration value name templates to allowedTemplates to avoid confusion
    • modified the js so the copy to clipboard code works on all browser
    • modified getCacheName method so it also checks for LanguageSupport and LanguageSupportPageNames

    Thanks again @webmanufaktur for the thorough tests!

    Source code(tar.gz)
    Source code(zip)
  • 1.0.2(Dec 3, 2021)

    This release fixes an issue where if LanguageSupport is installed but LanguageSupportPageNames is not, calling Page::localHttpUrl resulted in an error.

    Thanks again @webmanufaktur!

    Source code(tar.gz)
    Source code(zip)
  • 1.0.1(Dec 3, 2021)

    This release fixes some issues with the module configuration data getting/saving and also checks for ProcessWire's version to use the right function in the ProcessPageView::execute hook.

    Thank you @webmanufaktur for noticing these issues!

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Dec 2, 2021)

Owner
Romain Cazier
Interactive Designer
Romain Cazier
TYPO3 CMS extension which checks used CSS selectors in HTML output of the current page and removes CSS declarations which are unused.

EXT:css_coverage TYPO3 CMS extension which checks used CSS selectors in HTML output of the current page and removes CSS declarations which are unused.

Armin Vieweg 3 Apr 8, 2022
ProcessWire 3.x is a friendly and powerful open source CMS with a strong API.

Welcome to ProcessWire 3.x This document is in Markdown. An HTML formatted version of this document can be read at: https://github.com/processwire/pro

ProcessWire 804 Jan 3, 2023
wallabag is a self-hostable PHP application allowing you to not miss any content anymore

What is wallabag? wallabag is a self-hostable PHP application allowing you to not miss any content anymore. Click, save and read it when you can. It e

wallabag 7.7k Jan 4, 2023
Bedrock is a modern WordPress stack that helps you get started with the best development tools and project structure.

WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure

Roots 5.7k Jan 9, 2023
Create WordPress themes with beautiful OOP code and the Twig Template Engine

Timber helps you create fully-customized WordPress themes faster with more sustainable code. With Timber, you write your HTML using the Twig Template Engine separate from your PHP files.

Timber 5.2k Dec 31, 2022
Batteries include Drupal project template with Redis and object storage for assets.

Mojo An opinionated Drupal build designed to run in a cloud native environment. This is a work in progress, see the TODO.md for initial tracking of it

Bluehorn Digital 12 Apr 4, 2022
A repo of a simple blogsite in PHP, HTML and CSS.

A repository of a simple and fully functional blogsite - The Memoire, in PHP, HTML and CSS. The index page of this site has a summary of all the autho

Baaba Dampare 7 Jun 11, 2022
Project template for starting a project based on the Rabble admin system.

Note: this is an experimental project and heavily under development. If you do come across this repository, and you would like to support development,

Rabble 12 Oct 26, 2022
Provides Twig template IDE autocomplete of Craft CMS & plugin variables

Autocomplete for Craft CMS 3.x Provides Twig template IDE autocompletion for Craft CMS and plugin/module variables and element types. Works with PhpSt

nystudio107 35 Dec 21, 2022
Bismuth CMS is a ready-made Website CMS based on Yii 2 Advance Template

Bismuth CMS is a ready-made Website CMS based on Yii 2 Advance Template, it's the simplest and easy to set up CMS you may come across.

Hamadas Telebrain 1 Feb 11, 2022