[Typo3] Direct Mail (extended) : mass send with manual typed list not working anymore

W van Bruggen w.van.bruggen at gmail.com
Sun Nov 13 14:46:50 CET 2005


I've managed to fix this bug by comparing between the original
directmail 1.1.0 version of class.mod_web_dmail.php and the
class.ux_mod_web_dmail.php from direct mail extended. The problem
seems to be that both the testing module and and the manual typed list
use the same part in the function cmd_send_mail() part. The code used
in DM extended is fine for the testmail part, but the mass send mail
part uses  different form fields. To fix this, and keep both options
working i edited class.ux_mod_web_dmail.php. This is what you need to
do to fix this (i cant give you any linenumbers, my file is modified
on more parts  than the original file):

- find this line, this is from the function cmd_testmail($row)    { :
$msg.= '<input type="Submit" name="mailingMode_simple" value="' .
$LANG->getLL('dmail_send') . '">';

- Change the name of the inputfield into "mailingMode_simpletest"

- search for the function cmd_send_mail($row) :

- Now use the following code for a part of the function instead of the
original parts :

    function cmd_send_mail($row)    {
        global $LANG;

        // Preparing mailer
        $htmlmail = t3lib_div::makeInstance("t3lib_dmailer");
        $htmlmail->start();
        $htmlmail->dmailer_prepare($row);    // ,$this->params

        $this->back = '<input type="Submit" value="' .
$LANG->getLL('dmail_back') . '"
onClick="jumpToUrlD(\'index.php?id='.$this->id.'&sys_dmail_uid='.$this->sys_dmail_uid.'\');
return false;">';

        $sentFlag=false;
        if (t3lib_div::GPvar("mailingMode_simple"))    {
                // Fixing addresses:
          $addressList = t3lib_div::_GP('email') ?
t3lib_div::_GP('email') :
$GLOBALS["SOBE"]->MOD_SETTINGS["dmail_test_email"];
            $addresses = split(chr(10)."|,|;",$addressList);

            while(list($key,$val)=each($addresses))    {
                $addresses[$key]=trim($val);
                if (!strstr($addresses[$key],"@"))    {
                    unset($addresses[$key]);
                }
            }
            $hash = array_flip($addresses);
            $addresses = array_keys($hash);
            $addressList = implode($addresses,",");

            if ($addressList)    {
                    // Sending the same mail to lots of recipients
                $htmlmail->dmailer_sendSimple($addressList);
                $sentFlag=true;
                $theOutput.=
$GLOBALS["SOBE"]->doc->section($LANG->getLL('send_sending'),fw($LANG->getLL('send_was_sent').
'<br /><br />' . $LANG->getLL('send_recipients') . '<br
/>'.$addressList.'<br /><br />'.$this->back));
                $this->noView=1;
            }
        } elseif (t3lib_div::GPvar("mailingMode_simpletest"))    {
                // Fixing addresses:
// <MTK: use correct form field>
            $addresses = t3lib_div::GPvar("SET");
            $addressList = $addresses['dmail_test_email'] ?
$addresses['dmail_test_email'] :
$GLOBALS["SOBE"]->MOD_SETTINGS["dmail_test_email"];
            $addresses = split(chr(10)."|,|;",$addressList);
// </MTK: use correct form field>
            while(list($key,$val)=each($addresses))    {
                $addresses[$key]=trim($val);
                if (!strstr($addresses[$key],"@"))    {
                    unset($addresses[$key]);
                }
            }
            $hash = array_flip($addresses);
            $addresses = array_keys($hash);
            $addressList = implode($addresses,",");

            if ($addressList)    {
                    // Sending the same mail to lots of recipients
                $htmlmail->dmailer_sendSimple($addressList);
                $sentFlag=true;
                $theOutput.=
$GLOBALS["SOBE"]->doc->section($LANG->getLL('send_sending'),fw($LANG->getLL('send_was_sent').
'<br /><br />' . $LANG->getLL('send_recipients') . '<br
/>'.$addressList.'<br /><br />'.$this->back));
                $this->noView=1;
            }
        } else {    // extended, personalized emails.

- So you need to cut/paste this up up to the else statment, from which
the original code states stays intact.

This code uses part of the original direct mail, and keeps all the
locallang support intact from direct mail extended. Ofcourse, use it
at your own risk (its working ok on my install). If you are interested
in the modified class class.ux_mod_web_dmail.php, email.

Greets,
Wietse van Bruggen
w.van.bruggen at gmail.com

On 10/31/05, W van Bruggen <w.van.bruggen at gmail.com> wrote:
> Hello list,
>
> I installed Direct Mail extended to fix some issues, but it seems like it
> has broken something too. I can compile the newsletter for both text and
> html just fine, testmails work and direct mails to groups works. However,
> sending it to manual typed list is not functioning anymore. When typing all
> the addresses i want it to be sent out to, and pressing 'Send' i immediatly
> get sent back to the direct mail configuration page (where i compile, test
> etc). No e-mail is being sent. All other mail sending options work fine. Is
> this a specific problem with the extended direct mail? I might add that in
> the standard direct mail module, this option worked fine on this install.
>
> system :
> Typo3 3.7
> Direct Mail 1.0.8
> Direct Mail Extended 0.3.0
> Sendmail on FreeBSD Server
>
> greets,
> Wietse van Bruggen
> _______________________________________________
> Typo3-english mailing list
> Typo3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>



More information about the TYPO3-english mailing list