MailWizz into a Progressive web app

Ludovic

Member
There is a hook, see https://hooks-docs.mailwizz.com/actions.php?keyword=after_opening_body_tag which you can use:
Code:
<?php

Yii::app()->hooks->addAction('after_opening_body_tag', function(){
?>

<script>....</script>

<?php
});
Add that into apps/init-custom.php and it will be okay on upgrades as well.
Thank you!
it doesn't work the way i would like, i don't know if this is because the code is not placed in the right place (it should be in the header of the page ~/customer/guest/index) or if it is is because the linked files are also not placed in the right place (I put them in the root of the MailWizz installation but maybe they should be somewhere else?).
 

Attachments

  • Screen Shot 2021-08-19 at 10.34.09.png
    Screen Shot 2021-08-19 at 10.34.09.png
    147.9 KB · Views: 6

twisted1919

Administrator
Staff member
Well, you do have some local files, you'll need to link them using an absolute url not a relative one.
So you can put that folder from the right in your image in the document root where mailwizz is installed, say in a folder called pwa, next to the apps folder for instance.
Then in the hook, when you need to add those tags, put absolute urls to the resources, i.s: instead of pwa-custom.js use https://www.your-mailwizz-app.com/pwa/pwa-custom.js
 
Top