MJML
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
MJML
Hello,
I read this article: https://aimeos.org/tips/responsive-emai ... in-aimeos/
and installed mjml.
Afterwards, I copied the mjml-files from ai-client-html/client/html/templates/email to my extension directory.
I changed the mjml files, then started mjml to create php files. Works.
But when I run the order confirmation task in the TYPO3 planner, I get an error:
Call to a member function html() on null
client/html/templates/email/payment/html-body-standard.php line 5
$enc is not available.
When I run the task on the command line, there is no error message - but no emails, either.
typo3cms aimeos:jobs order/email/payment default
What configuration is necessary to make this work?
Claudia
I read this article: https://aimeos.org/tips/responsive-emai ... in-aimeos/
and installed mjml.
Afterwards, I copied the mjml-files from ai-client-html/client/html/templates/email to my extension directory.
I changed the mjml files, then started mjml to create php files. Works.
But when I run the order confirmation task in the TYPO3 planner, I get an error:
Call to a member function html() on null
client/html/templates/email/payment/html-body-standard.php line 5
$enc is not available.
When I run the task on the command line, there is no error message - but no emails, either.
typo3cms aimeos:jobs order/email/payment default
What configuration is necessary to make this work?
Claudia
Re: MJML
No configuration necessary. You only have to make sure that you insert the PHP code before and after the MJML code in the generated HTML code again because MJML removes that.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: MJML
I think the origin of the problem is the generation of the php files from mjml.
According to the documentation, I ran:
npm install -l mjml
mjml html-body-standard.mjml -o html-body-standard.php
The resulting php file look much different from the php files which are provided by aimeos.
So, what's the correct way to generate these files?
According to the documentation, I ran:
npm install -l mjml
mjml html-body-standard.mjml -o html-body-standard.php
The resulting php file look much different from the php files which are provided by aimeos.
So, what's the correct way to generate these files?
Re: MJML
We haven't tested that way yet because we create the PHP files in Visual Studio Code directly
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: MJML
Oh! Then the article https://aimeos.org/tips/responsive-emai ... in-aimeos/ is really misleading, especially the last paragraph.
Do I get it right, that I don't need the MJML files at all, but should rather copy the PHP files and work on these and take care not to destroy the mjml syntax?
Do I get it right, that I don't need the MJML files at all, but should rather copy the PHP files and work on these and take care not to destroy the mjml syntax?
Re: MJML
There are all options listed to generate HTML code from MJML syntax but we havn't tried all ourselves.
Nevertheless, the output is not as minimized the the distributed one but seems to be the same when running the NPM command:
The PHP files contains the HTML code generated by MJML which is a) rather ugly and b) hard to extend by hand. So the best option is still to copy the MJML files (there's also a shared file here: https://github.com/aimeos/ai-client-htm ... ail/common), modify the copied MJML files and generate the PHP files you want to replace (add the PHP code before and after the MJML syntax again in the generated files).
Nevertheless, the output is not as minimized the the distributed one but seems to be the same when running the NPM command:
Code: Select all
mjml html-body-standard.mjml -o html-body-standard.php
The PHP files contains the HTML code generated by MJML which is a) rather ugly and b) hard to extend by hand. So the best option is still to copy the MJML files (there's also a shared file here: https://github.com/aimeos/ai-client-htm ... ail/common), modify the copied MJML files and generate the PHP files you want to replace (add the PHP code before and after the MJML syntax again in the generated files).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: MJML
I created a script which does the tedious task for me:
Code: Select all
#!/bin/bash
# run mjml on the content within the mjml tags
# split before the starting tag
# after this, start0 contains the starting php
csplit -n 1 -sf start -z html-body-standard.mjml /\<mjml\>/ {*}
# split after the ending tag
# end0 is the mjml part, end1 is the ending php
csplit -n1 -sf end -z start1 /\<\/mjml\>/+1 {*}
# now run mjml
mjml end0 --config.minify -o mjml
# concatenate the bits and pieces
cat start0 mjml end1 > html-body-standard.php
# tidy up
rm start* end* mjml
Re: MJML
There are probaby some settings missing (detail page ID, etc.) if you use it that way. Recommendation is to configure a scheduler task and run that using ./typo3/cli_dispatch.phpsh or ./vendor/bin/typo3 scheduler:run
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: MJML
I have actions/scripts which I want to run directly before/after sending the payment mails. The TYPO3 scheduler is too coarse for this.
Which settings are necessary? It would be great, if the aimeos job would notify the user if something is missing...
Or to provide a debug option which e.g. outputs the SQLs used or the recipients of the mails.
Which settings are necessary? It would be great, if the aimeos job would notify the user if something is missing...
Or to provide a debug option which e.g. outputs the SQLs used or the recipients of the mails.