Zum Inhalt springen

Kategorien unter Direct Mail???

Erstellt am 7. Januar 2011 · 2 Antworten · letzte Antwort am 7. Januar 2011

Tags: Kategorien, Direct Mail, Frage

frabovmeier ·

Hallo,

ich bin am Verzweifeln mit Direct Mail und den Kategorien. Im Netz gibt es leider keine wirklich guten Anleitungen und Lösungen zu meinem Problem finde ich bisher auch nicht. Vielleicht könnt ihr mir helfen.

Zu erst, ich verwende folgende Extensions:
- direct_mail 2.6.8
- tt_address 2.2.1
- direct_mail_subscription 1.1.0

mit Typo 4.4.0.

Ich hab auf dem Root ein SysOrder "Newsletter" und unterhalb diesen ein SysOrder "Abonnenten" eingerichtet. Newsletter enthält Plugin "Direct Mail".
Dann hab ich eine Anmeldeseite dass das Plugin "Direct Mail Anmeldung" enthält und der Ausgangspunkt ist der SysOrdner "Abonnenten". So soll es ja auch sein.

Dann hab ich im TS vom SysOrder "Newsletter" diesen stehen: (170 ist die PID von "Abonnenten")

TCEFORM.tt_content.module_sys_dmail_category.PAGE_TSCONFIG_IDLIST = 170
TCEFORM.tt_address.module_sys_dmail_category.PAGE_TSCONFIG_IDLIST = 170
TCEFORM.fe_users.module_sys_dmail_category.PAGE_TSCONFIG_IDLIST = 170
TCEFORM.sys_dmail_group.select_categories.PAGE_TSCONFIG_IDLIST = 170

page = PAGE

page.headerData.10=TEXT
page.headerData.10.value (
<style type="text/css">
* {margin:0;padding:0;}
body {background: #eee;}
div#main {padding:12px;}
</style>
)
page.bodyTag=<body>
page.10 < styles.content.get
page.10.wrap = <div id="main">|</div>

die Konstanten vom SysOrdner "Newsletter":

plugin.tx_directmail_pi1.siteUrl = http://s04/ibes/
plugin.feadmin.dmailsubscription.pid = 170
plugin.feadmin.dmailsubscription.email = irgendwer@domain.de
plugin.feadmin.dmailsubscription.emailName = Ich Halt

jetzt noch das TS von "Abonnenten":

TCEFORM.tt_content.module_sys_dmail_category.disabled = 0
TCEFORM.tt_address.module_sys_dmail_category.disabled = 0
TCEFORM.fe_users.module_sys_dmail_category.disabled = 0
TCEFORM.sys_dmail_group.select_categories.disabled = 0

Jetzt zu meinem Problem.

Ich lege im Sysordner "Abonnenten" Kategorien an. Mit dem TS für diesen SysOrder (siehe gerade eben oben) soll es möglich sein, beim Erstellen des Newsletter oder beim Versenden (wo auch immer) auch Kategorien auswählen zu können. Aber nix ist!!!!!

Wie zu Teufel kann ich beim Versand im Backend die Kategorie auswählen? Denn nur an diese User, die diese Kategorien bei der Anmeldung gewählt haben, soll der Newsletter versand werden.

Kann jemand das Problem erkennen???

Ich hab immer gedacht beim Anlegen des Newsletter kann ich auswählen, zu welcher Kategorie der Newsletter gehört. Aber so eine Auswahl gibt es einfach nicht!

Bitte helft mir! Danke!!!

ikkez ·

Hallo auch...

mensch hast du ein Glück,...
ich hab mich bisher schon die ganze Woche damit rumgeschlagen und
habe es jetzt weitestgehend am laufen... und da ich keine Lust habe,
mich beim nächsten Projekt wieder damit rumschlagen zu müssen,
hab ich mal alles dokumentiert 😉

ich glaub in deiner Config fehlt noch ein wenig, so auf den ersten Blick.

hier meine Konfiguration für Typo3 4.4.6, DirectMail 2.6.8 und direct mail subscription 1.1.0 😉

Direct Mail Configuration

Seitenbaum:
+ templates (ordner)
    - direct_mail_subscription (template)
+ newsletter (ordner)
    +newsletterseite1
    +newsletterseite2
    + abonenten (ordner)
    -direct_mail_config (template)
    -kategorie1
    -kategorie2
    -empfängerliste1
+ hauptseite(seite)
    - root_template (template)
    +unterseite1
    +unterseite2
    + ...

template file im newsletter ordner:

constants:

styles.header.gfx1.maxWidth = 0
styles.header.gfx1.wrap = |
styles.header.gfx1.niceText = 0
styles.content.imgtext.maxWInText = 0
styles.content.imgtext.linkWrap.width = 800
styles.sitemap.text.itemWrap = |

plugin.tx_directmail_pi1.siteUrl = h t t p:// w w w.your domain.de/typo3_446
# für subscription:
plugin.feadmin.dmailsubscription.pid = 189
plugin.feadmin.dmailsubscription.email = e m a i l @ d o m a i n.de
plugin.feadmin.dmailsubscription.emailName = dein name

setup:

page = PAGE

# aufräumen
plugin {
  tx_cssstyledcontent._CSS_DEFAULT_STYLE >
  tx_ttaddress_pi1 >
  tx_newloginbox_pi1 >
  tt_content._DEFAULT_CSS >
}
page {
  stylesheet >
  headerData.10 > 
  config {
    remove_defaultJS = 1 
    #baseURL = h t t p : / / w w w.your domain .de/typo3_446/
  }
}
config.disableAllHeaderCode = 0
config.inlineStyle2TempFile = 0

# newsletter config
page.headerData.10=TEXT
page.headerData.10.value (
<style type=text/css>
* {margin:0;padding:0;}
body {background: #fff;}
div#main {
  width: 625px;
  padding-top:20px;
  padding-left:100px;
  padding-right:50px;
  color: #888;
  font-family: Georgia,serif;
  font-size: 14px;
}
h1 {margin-bottom: -15px; font-size: 26px;}
h2 {font-size:16px; margin:20px 0 10px;}
p.bodytext {margin-bottom: 10px;}
</style>
)
#page.bodyTag=body
page.10  < styles.content.get
page.10.wrap = <div id="main">|</div>

müsste noch angepasst werden, für ein hübsches newsletter template

Root Template (auf Hauptseite)
1. Statische Templates einschließen (aus Erweiterungen):
alle Direct Mail Objecte auswählen
2. Basis-Template einschließen:
direct_mail_subscription template hinzufügen

Direct Mail Subscription Configuration

direct_mail_subscription template file:

constants:

# newsletter config
plugin.feadmin.dmailsubscription {
  #pid = ordner zum user abspeichern
  pid = 189
  file.templateFile = fileadmin/layout/newsletter_templates/subscrip.html
  email = post@email.de
  emailName = Newsletter der XYZ Firma
  table=tt_address
 
  # html als Standard
  #create.overrideValues.disable = 1
  #create.overrideValues.module_sys_dmail_html = 1
}

setup:

plugin.feadmin.dmailsubscription {
  create.overrideValues.module_sys_dmail_html = 1
  # kategorie edit funktion fixen
  edit.userFunc_afterSave = user_dmailsubscribe->saveRecord
  setfixed {
    approve._FIELDLIST = uid,pid
    delete._FIELDLIST = uid,pid
  }
  evalErrors.email {
    uniqueLocal = Sie sind bereits für unseren Newsletter eingetragen!
    email = Die Mailadresse ist ungültig!
  }
}
# kategorie config, id wo kategorien gespeichert sind
plugin.feadmin.dmailsubscription.cObjects.CATLIST.pid = 188

TSConfig auf Newsletter Ordner:

# kategorien im backend für tt_address verfügbar machen, id wo die kategorien gespeicher sind
TCEFORM.tt_content.module_sys_dmail_category.PAGE_TSCONFIG_IDLIST = 188
TCEFORM.tt_address.module_sys_dmail_category.PAGE_TSCONFIG_IDLIST = 188
TCEFORM.fe_users.module_sys_dmail_category.PAGE_TSCONFIG_IDLIST = 188
TCEFORM.sys_dmail_group.select_categories.PAGE_TSCONFIG_IDLIST = 188
TCEFORM.tt_content.module_sys_dmail_category.disabled = 0
TCEFORM.tt_address.module_sys_dmail_category.disabled = 0
TCEFORM.fe_users.module_sys_dmail_category.disabled = 0
TCEFORM.sys_dmail_group.select_categories.disabled = 0

Subscription class.dmailsubscribe.php fixen
da sonst fehlverhalten beim editieren vom abo der user eintreten, wenn kategorieren geändert werden.

<?php
class user_dmailsubscribe {
    var $cObj; //Instance of tslib_content
    /**
     * Constructor
     */
    function user_dmailsubscribe()    {
        $this->cObj = t3lib_div::makeInstance('tslib_cObj');
    }
    /**
     *
     */
   
    function makeCheckboxes($content,$conf) {
        $content = '';
        $pid = $this->cObj->stdWrap($conf['pid'],$conf['pid.']);

        if($address_uid = t3lib_div::_GP('rU')) {
            $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','sys_dmail_ttaddress_category_mm','uid_local='.intval($address_uid));
            $subscribed_to=array();
            while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                $subscribed_to[] = $row['uid_foreign'];
            }
            $subscribed_to_list = implode(',',$subscribed_to);
        }

        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','sys_dmail_category','l18n_parent=0 AND pid='.intval($pid).$this->cObj->enableFields('sys_dmail_category'));

        while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
            $checked = t3lib_div::inList($subscribed_to_list,$row['uid']);
            //$content .= $row['category'].'<input type="checkbox" '.($checked?'checked':'').' name="FE[tt_address][module_sys_dmail_category][]" value="'.$row['uid'].'" /><br />';

                //Stanislas way of doing localization is different, alsways subscred to the original uid, and not the translated overlay records.

            if($theRow = $GLOBALS['TSFE']->sys_page->getRecordOverlay('sys_dmail_category',$row,$GLOBALS['TSFE']->sys_language_uid,$conf['hideNonTranslatedCategories']?'hideNonTranslated':'')) {
                $content .= '<input type="checkbox" '.($checked?'checked':'').' name="FE[tt_address][module_sys_dmail_category]['.$row['uid'].']" value="1" class="module_sys_dmail_category" /> '.$theRow['category'].'<br />';
            }

        }
        return $content;
    }
    /**
    *
    */
    function saveRecord($conf)    {
        //print "TEST";
        //t3lib_div::print_array($conf);
        if(intval($conf['rec']['uid'])) {
            $GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_dmail_ttaddress_category_mm','uid_local='.intval($conf['rec']['uid']));
            $fe = t3lib_div::_GP('FE');
            $newFieldsArr = $fe['tt_address']['module_sys_dmail_category'];

            //$newFields = implode(',',$newFieldsArr);
            //print "NewFields: $newFields<br />";
            $count = 0;
            if(is_array($newFieldsArr)) {
                foreach(array_keys($newFieldsArr) as $uid) {
                    $count++;
                    $GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_dmail_ttaddress_category_mm',array('uid_local'=>$conf['rec']['uid'],'uid_foreign'=>$uid,'sorting'=>$count));
                }
                $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tt_address','uid='.intval($conf['rec']['uid']),array('module_sys_dmail_category'=>$count));
            }
            // merge name field
            if(empty($conf['rec']['name']))    {
                if(!empty($conf['rec']['first_name'])) {
                    $name=$conf['rec']['first_name'];
                    if(!empty($conf['rec']['last_name'])) {
                        $name.=' '.$conf['rec']['last_name'];
                    }
                    $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tt_address','uid='.intval($conf['rec']['uid']),array('name'=>$name));
                }
            }
            if(t3lib_div::_GP('cmd')!='edit') { // not do that when editing records
                $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tt_address','uid='.intval($conf['rec']['uid']),array('hidden'=>1));   
            }
           
        }
        return;
    }
}
?>

hier noch ein paar link die mich auf den richtigen weg gebracht haben:

http://blog.undkonsorten.com/typo3-newsletter-direct-mail-subscription
(hatte es erst genau so gemacht, aber es lief trotzdem nicht alles)

http://circusofmymind.blogspot.com/2007/09/typo-3-direct-mail-subscription.html

viel glück 😉
grüße

ikkez ·

achso... und wenn alles richtig läuft,
kannst du dann im Datensatz deiner Abonnenten auch die Kategorien sehen und ändern, welche dieser Nutzer bekommt.

Im Template zur Anmeldung, kannst du dann mit dem Marker ###CE_CATLIST### eine Liste der Kategorien ausgeben lassen. Diese wird dynmisch von der Funktion makeCheckboxes() aus class.dmailsubscribe.php erstellt. Kannste also dort bei bedarf anpassen, falls die noch irgendwie anders erzeugt werden sollen.

cheers.