We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9995
    • 1,613 Posts
    are these custom TVs ?

    if so:
    check / ajax / send.php
    //replace template variables for proper output
    $body = insert('content', $intro . $doc['content'], $template['content']);
    $body = insert('longtitle', $doc['longtitle'], $body);
    $body = insert('banner', $doc['banner'], $body);
    $body = insert('alias', $doc['alias'], $body);
    // custom TVs here:
    $body = insert('nb-kop1', $tvs['nb-kop1'], $body);
    $body = insert('nb-txt1', $tvs['nb-txt1'], $body);
    $body = insert('nb-thumb1', $tvs['nb-thumb1'], $body);



    how can this be all of a sudden?
    is it on the same host?
    never had that before

      Evolution user, I like the back-end speed and simplicity smiley
      • 15001
      • 697 Posts
      how can this be all of a sudden?
      The newsletter was being sent but not its content because I'm used to call my templates from text files, through the LoadTemplate Plugin.

      But it was not loading the template when sending a newsletter with TE Mailer.

      So, for testing purposes I had selected the "blank" template instead, hoping that TE Mailer would use the content field as text for the newsletter, but it did not ; currently, it really requires a template other than blank.

      Now that I store the template directly in MODx (aka in MySQL) the newsletter system works fine.
        • 15001
        • 697 Posts
        Improving TE Mailer to allow importing suscribers from another table?

        I'm trying to improve TE Mailer for the situation where the members of an association are stored in an other table should be imported as new suscribers of the newsletter when its editor clicks some "Create new suscribers from members table" button.

        I also want the email addresses of existing suscribers being updated when the editor clicks some "Update email addresses from members table" button, because email addresses may have changed in the members table.

        Those buttons should be on the "Edit mailing list" tab. (edit.php)

        I modified the structure of TE Mailer to add a "firstname" field as well as a title field (Mister, Madam).

        The corresponding fields have different names in table "membres" than in table "temailinglist" and should match this way:
        titre -> title
        prenom -> firstname
        nom -> name

        I wrote those two untested functions below which should be called by the two buttons.
        	/* Insert new suscribers from members */
        function CreateNewSuscribersFromMembers {
        	
          global $modx;
        	 
          $members = $modx->getFullTableName('membres');
          $suscribers = $modx->getFullTableName('temailinglist');
            
          $query = "INSERT INTO ".$suscribers." (title, firstname, name, email) SELECT (titre,prenom,nom,email) FROM ".$members." WHERE (email AND (prenom,nom) NOT IN (SELECT firstname,name FROM ".$recipients."))"; 
            $result = $modx->db->query($query);
          }
        	
          /* Update emails of existing membres according to members with same firstname and name in table $members  */
        function UpdateEmailAddresses {
          global $modx;
        
          $members = $modx->getFullTableName('membres');
          $suscribers = $modx->getFullTableName('temailinglist');
            
          $query = "UPDATE ".$suscribers." INNER JOIN ".$members." ON (".$members.".nom = ".$suscribers.".name) INNER JOIN ".$membres." ON (".$membres.".prenom = ".$suscribers.".firstname) SET ".$suscribers.".email = ".$members".email";
            $result = $modx->db->query($query); 
          }


        I wonder about the best method to insert such code in TE Mailer, either transforming the file "edit.php" into a PHP class or storing the update functions in other files called in Ajax.

        Of course, the grid of suscribers which is generated by MySQLPHPGrid should be refreshed after the underlying "temailinglist" table was updated.

        Advice from an experienced TE Mailer developper would be much welcome.

        Thanks.

        --------------
        The reasons for keeping a distinct table of recipients for the newsletter:

        1. Some members don't have any email.
        2. I don't want to add new columns like the "unsuscribe" one to the existing members table, because it could possibly make other scripts crash if not modified too.
        3. The editor of the newsletter should be able to add recipients that are not members.
        4. The editor of the newsletter should be able to remove recipients without deleting members (although I'm aware of the "unsuscribe" feature.

        If I was building the website from scratch, things could be different, but I'm adding the TE Mailer module to an existing website.
          • 9995
          • 1,613 Posts
          I have another improvement would be very welcome:
          I hate the subscribe snippet needs mootools, I always end up with iframe for subscribing sad
            Evolution user, I like the back-end speed and simplicity smiley
            • 9995
            • 1,613 Posts
            Jul, or someone else,

            I seem to have weird problems with the grid.
            When I add a new subscriber in the module by clicking on the + icon its not doing adding a row.
            When I refresh the iframe its visible... very buggy.

            Also when I delete a row and refresh its there again, but its deleted in the database table when checking phpmyadmin.
            So it looks like there is some caching going on?!

            I have a site where that issue isn't there.
            I tried everything to solve this. Did a complete copy of the module, even replaced database tables so I have a exact copy the good one but still there is the weird issue. Its not a browser thing. Tested on many browsers on different locations.
            The type of database is the same.

            Really don't know how to solve this sad

            Client can't add or remove subscribers in the manager/module.
            Can you add / remove adresses without problems? [ed. note: fourroses666 last edited this post 8 years, 9 months ago.]
              Evolution user, I like the back-end speed and simplicity smiley
              • 15001
              • 697 Posts
              Hi,

              I started adapting TEMailer with the following goals:

              • true MODx module styling (nice tabs better layout)
              • getting rid of iframes
              • better interface using Ajax and jQuery

              Edit ------------------------------------------
              (content removed because outdated)

              TE Mailer 1.6 build 002 (in developement):
              Attachments in this post are outdated.
              Please see my next post below, to download build 002.
              ------------------------------------ End of Edit

              @fourroses666:
              Client can't add or remove subscribers in the manager/module.
              Can you add / remove adresses without problems?
              Sorry for the late answer: I believe it was working for me, but currently I cannot test as I'm working on improving TEMailer. We can work together on this partial rewriting if you want. [ed. note: Jul last edited this post 8 years, 7 months ago.]
                • 9995
                • 1,613 Posts
                Hey, nice work!

                At the moment I don't have much time, and I'm not a coder sad

                Don't know if you are known with github.
                I can add it to github if you want so other people can download it.
                  Evolution user, I like the back-end speed and simplicity smiley
                  • 15001
                  • 697 Posts
                  Hi,

                  I will call this project TE Mailer 1.6
                  (see my previous post in this thread if you haven't read it yet).

                  All files of the new build 0.0.2 are available here http://altipoint.ch/dev/temailer, as wells as screenshots.

                  In the zip archive are also two ".sql" files that you can use to create and populate some demo tables.

                  What's new in this build:
                  - Mailing list and Mailing groups tabs are now correctly initialized

                  Next things to do (contributors are welcome):

                  1. In function ShowTable() of MySQLPHPGrid/mysqlphpgrid.class.php, a the HTML header contains a script with lot a javacript functions.
                  (These functions are what makes the tables dynamic.)
                  The script containing these functions should be moved to <head> in inc/headermin.php (which is called by temailer.php) or alternatively echoed by mysqlphpgrid.class.php. In such case, the script would insert inself in to the <body> of the module. The important think to keep in mind is that this new version of TE Mailer will still use Ajax.

                  2. In function UpdateTable() of MySQLPHPGrid/mysqlphpgrid.class.php, I had to comment out this line
                  if ($_REQUEST["a"]) exit($res);	//Ajax: don't do any further processing'
                  as $res was false and the exit() blocked the module.
                  A solution must be found to adapt this code instead of commenting it out.

                  3. The height of tab panes is not adapting to the content.
                  In inc/headermin.php, I tried added the .clearfix css class.
                  Then, in temailer.php, I tried to replace <div class="tab-pane"
                  by <div class="tab-pane clearfix", but it conflicted with how the tabs behave.

                  Note 1: a version of mysqlphpgrid.class.php with comments echoed to help debugging is available in the file debugging__mysqlphpgrid.class.php

                  Note 2: If you improve the module and want to share it with others, please put your files contact me per PM. I will publish the new builds.
                  ----------------------
                  @fourroses66:
                  Don't know if you are known with github.
                  I can add it to github if you want so other people can download it
                  Hi!
                  Thanks. I'm aware of GitHub but not using it currently.
                  All files are now available in a zip file, including SQL queries to create the tables. If others help in coding, I'll post the latest version.
                  ---------------------- [ed. note: Jul last edited this post 8 years, 7 months ago.]
                    • 9995
                    • 1,613 Posts
                    At the moment I see http://altipoint.ch is offline
                      Evolution user, I like the back-end speed and simplicity smiley
                      • 15001
                      • 697 Posts
                      Quote from: fourroses666 at Sep 21, 2015, 12:05 PM
                      At the moment I see http://altipoint.ch is offline
                      There has been a flood attack yesterday on the server. Its working now. It's better to contact me per PM in such case.