We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39498
    • 169 Posts
    So, I made some tests, and encountered two problems:

    $this->modx->mail->set(modMail::MAIL_BODY_TEXT, $this->html);

    With that modification I get an alternative plain text version, but all with html tags, so theres no stripping off the tags.

    Setting the TV for the css to chunk and giving it a name of an existing chunk I get this error:
    Could not get CSS file: /www/htdocs/modx-2.2.4-pl/assets/components/emailresource/css/my.css
      • 3749
      • 24,544 Posts
      On the first issue, when I looked at the PhpMailer code, it looked like it stripped tags if that field was sent. I guess not. The Notify extra has a nice tag stripper: core/components/notify/model/notify/html2text.php

      If you put that file in the core/components/emailresource/model/emailresource directory and change your code to this, it *should* strip the tags:

      require_once('html2text.php');
      $h2t = new html2text($this->emailText);
      $this->modx->mail->set(modMail::MAIL_BODY_TEXT, $h2t->get_text());



      On the second, it might be a bug. Did you use all uppercase for CHUNK in the CSS Mode TV (no quotes) and is the name of the chunk spelled correctly - it's case-sensitive?


      ------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using.
      MODX info for everyone: http://bobsguides.com/modx.html

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 39498
        • 169 Posts
        Line 2 must be:
        $h2t = new html2text($this->html);

        and it works. Miss a litte controll on formating, maybe I will check the script or render an own alt text.

        Concerning the css: I tried several variations on spellings. Using a chunk named MYCSS with “CSS MODE: CHUNK“ and “CSS File(s): MYCSS“ – gets the error. Now I saved the chunk as static file as “MYCSS.css“, “CSS MODE: FILE“ and “CSS File(s): MYCSS.css“, that does the job. I have no idea, why chunk mode does not.
          • 39498
          • 169 Posts
          But there is still some point concerning the installation. The package has still the status “uninstalled“ in the package management. I mentioned the problems during installation. I hope not to run into any problems if I am using the installation in a project.
            • 3749
            • 24,544 Posts
            Thanks for the feedback. I'll have to check that out when I get a chance.

            Can you tell me the version of ER reported in Package Manager?

            Sorry about the variable name, I pasted the code from another extra and forgot to change it.


            ------------------------------------------------------------------------------------------
            PLEASE, PLEASE specify the version of MODX you are using.
            MODX info for everyone: http://bobsguides.com/modx.html
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 39498
              • 169 Posts
              ER: 1.1.2 rc2
              MODX Rev 2.2.4-pl

              I loaded it with the package manager. At the extras repository on modx.com 1.1.2 rc1 is given as actual and 1.1.2 rc2 as outdated!? [ed. note: spica8 last edited this post 14 years ago.]
                • 3749
                • 24,544 Posts
                Thanks, that matches the latest version I have (except for the changes I gave you).

                ER is about due for an overhaul. I hope to get to it in December.


                ------------------------------------------------------------------------------------------
                PLEASE, PLEASE specify the version of MODX you are using.
                MODX info for everyone: http://bobsguides.com/modx.html
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 39498
                  • 169 Posts
                  I loaded it with the package manager. At the extras repository on modx.com 1.1.2 rc1 is given as actual and 1.1.2 rc2 as outdated!?

                  But can I assume, that it will run stable until then, as it is?
                    • 3749
                    • 24,544 Posts
                    This is probably going to sound insulting, but could you try one last thing for me?

                    1. Set the CSS Mode TV to CHUNK, making sure there are no spaces before or after and no quotes.
                    2. Set the CSS File TV to the name of your chunk, again with no spaces or quotes
                    3. Save the resource
                    4. Edit the chunk and paste in the name you used in the CSS File TV, again with no spaces or quotes.
                    5. Save the chunk
                    6. Delete all the files in the core/cache directory.

                    I'm almost positive that there are people using the CHUNK option successfully.

                    ------------------------------------------------------------------------------------------
                    PLEASE, PLEASE specify the version of MODX you are using.
                    MODX info for everyone: http://bobsguides.com/modx.html
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 39498
                      • 169 Posts
                      Still getting
                      Could not get CSS file: /www/htdocs/modx-2.2.4-pl/assets/components/emailresource/css/MYCSS


                      Just to assure: with 1. you mean only to set the radiobutton to CHUNK? There is nothing where spaces or quotes could be set.