liminspace / django-mjml

The simplest way to use MJML in Django templates.
MIT License
263 stars 32 forks source link

MJML tags not being recognized #112

Closed narveer-rathore closed 4 years ago

narveer-rathore commented 4 years ago

I have installed mjml@4.3.2 as a global package using npm and getting these errors when running the project.

lib/python3.7/site-packages/mjml/tools.py", line 49, in _mjml_render_by_cmd
    raise RuntimeError('MJML stderr is not empty: {}.'.format(force_str(stderr))) ******
*****
Element mj-section doesn't exist or is not registered
Element mj-text doesn't exist or is not registered
Element mj-body doesn't exist or is not registered

Its working fine if I use cmd to directly convert a mjml file. mjml test.mjml -o test.html produces output without Element mj-text doesn't exist or is not registered errors.

Packages: python_version = "3.7.5" django-mjml = "==0.10.1" Django = "==2.2.13"

liminspace commented 4 years ago

@narveer-rathore, mjml@4.3.2 doesn't exist. Try some other version instead. I think your MJML_EXEC_CMD has not the same path to mjml that mjml you use in the terminal. Be sure that you use correct value in MJML_EXEC_CMD option. BTW you should use tcpserver mode. It's much more faster and keeps your system clean ;)

narveer-rathore commented 4 years ago

@liminspace Sorry about that. I made a typo version was 4.6.2. There was a version mismatch between different could environments and scripts. Thanks for the advice 250 emails a once took a lot of time. Can tcpserver mode handle thousands of emails per 30 secs ? I'm thinking of rendering all templates on build time and use HTML for sending.

BTW thanks for reply. I'll close this issue.

liminspace commented 4 years ago

@narveer-rathore tcpserver can handle much more emails, but it depends of power of your hardware. and you can use several servers and handle more emails for the same time.