php – TYPO3:powermail从自己的扩展名中选择带有typoscript的数据

这是我在Stack Overflow上的第一篇文章.我在互联网上搜索了大约2天来解决我的问题.希望您能够帮助我.

我正在使用Typo3 7.6.2并使用E​​xtension Builder 7.6和Powermail 2.24.0创建了一个扩展

所以我想生成一个选择框来获取该学校的联系人的电子邮件地址,该地址是用数据库关系定义的.

如果我尝试通过从我或其他扩展表(tx_wtschools_domain_model_schools)中选择typoscript来获取数据,我将无法得到答案.

但如果我使用fe_user或fe_group,我会得到预期的答案.

所有记录都存储在ID为22的页面上

我使用了这个代码片段http://www.typo3.net/forum/thematik/zeige/thema/112554/
特别是从2014年9月19日,12:42(小卷轴向下)的帖子

从WT-Schools生成接收者列表

lib.receiver = COA
lib.receiver {
    10 = TEXT
    10.value = Bitte wählen|[\n]

    20 = CONTENT
    20 {
      table = tx_wtschools_domain_model_schools
      select.pidInList = 22
      #select.recursive = 100000

      renderObj = COA
      renderObj {
        10 = TEXT
        10.field = name
        10.wrap = |[\n]
       }
   }
   30 = TEXT
   30.value = Ende
}

所以我已经没有去过第二部分了,我是否会收到联系人的邮件.

感谢您的帮助,如果您需要更多信息,我会在这里发布!

问候Jan

这是学校表的SQL-Dump:

-- phpMyAdmin SQL Dump
-- version 4.5.5
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Erstellungszeit: 07. Apr 2016 um 09:06
-- Server-Version: 5.5.47-0+deb7u1
-- PHP-Version: 5.6.14

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Datenbank: `wt-kampfkunstschule`
--

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `tx_wtschools_domain_model_schools`
--

CREATE TABLE `tx_wtschools_domain_model_schools` (
  `uid` int(11) NOT NULL,
  `pid` int(11) NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `address` varchar(255) NOT NULL DEFAULT '',
  `address_info` varchar(255) NOT NULL DEFAULT '',
  `postcode` varchar(255) NOT NULL DEFAULT '',
  `city` varchar(255) NOT NULL DEFAULT '',
  `city_label` varchar(255) NOT NULL DEFAULT '',
  `latitude` varchar(255) NOT NULL DEFAULT '',
  `longitude` varchar(255) NOT NULL DEFAULT '',
  `info` varchar(255) NOT NULL DEFAULT '',
  `active` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `gallery` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `profile_image` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `activate_alt_training` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `owner` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `contact` int(11) UNSIGNED DEFAULT '0',
  `trainer` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `categories` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `training_time` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `training_time_alt` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `tstamp` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `crdate` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `cruser_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `deleted` tinyint(4) UNSIGNED NOT NULL DEFAULT '0',
  `hidden` tinyint(4) UNSIGNED NOT NULL DEFAULT '0',
  `t3ver_oid` int(11) NOT NULL DEFAULT '0',
  `t3ver_id` int(11) NOT NULL DEFAULT '0',
  `t3ver_wsid` int(11) NOT NULL DEFAULT '0',
  `t3ver_label` varchar(255) NOT NULL DEFAULT '',
  `t3ver_state` tinyint(4) NOT NULL DEFAULT '0',
  `t3ver_stage` int(11) NOT NULL DEFAULT '0',
  `t3ver_count` int(11) NOT NULL DEFAULT '0',
  `t3ver_tstamp` int(11) NOT NULL DEFAULT '0',
  `t3ver_move_id` int(11) NOT NULL DEFAULT '0',
  `sys_language_uid` int(11) NOT NULL DEFAULT '0',
  `l10n_parent` int(11) NOT NULL DEFAULT '0',
  `l10n_diffsource` mediumblob
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Daten für Tabelle `tx_wtschools_domain_model_schools`
--

INSERT INTO `tx_wtschools_domain_model_schools` (`uid`, `pid`, `name`, `address`, `address_info`, `postcode`, `city`, `city_label`, `latitude`, `longitude`, `info`, `active`, `gallery`, `profile_image`, `activate_alt_training`, `owner`, `contact`, `trainer`, `categories`, `training_time`, `training_time_alt`, `tstamp`, `crdate`, `cruser_id`, `deleted`, `hidden`, `t3ver_oid`, `t3ver_id`, `t3ver_wsid`, `t3ver_label`, `t3ver_state`, `t3ver_stage`, `t3ver_count`, `t3ver_tstamp`, `t3ver_move_id`, `sys_language_uid`, `l10n_parent`, `l10n_diffsource`) VALUES
(1, 22, 'WT-Zentrum Radevormwald', 'Kaiserstraße 69', 'direkt am Markt', '42477', 'Radevormwald', '', '51.203107', '7.356229', 'Ihre Selbstverteidigungschule in Radevormwald', 1, 4, 1, 0, 1, 7, 31, 3, 8, 0, 1458657850, 1458208785, 1, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, -1, 0, 0x613a32313a7b733a31363a227379735f6c616e67756167655f756964223b4e3b733a363a2268696464656e223b4e3b733a343a226e616d65223b4e3b733a373a2261646472657373223b4e3b733a31323a22616464726573735f696e666f223b4e3b733a383a22706f7374636f6465223b4e3b733a343a2263697479223b4e3b733a31303a22636974795f6c6162656c223b4e3b733a383a226c61746974756465223b4e3b733a393a226c6f6e676974756465223b4e3b733a343a22696e666f223b4e3b733a363a22616374697665223b4e3b733a373a2267616c6c657279223b4e3b733a31333a2270726f66696c655f696d616765223b4e3b733a32313a2261637469766174655f616c745f747261696e696e67223b4e3b733a353a226f776e6572223b4e3b733a373a22636f6e74616374223b4e3b733a373a22747261696e6572223b4e3b733a31303a2263617465676f72696573223b4e3b733a31333a22747261696e696e675f74696d65223b4e3b733a31373a22747261696e696e675f74696d655f616c74223b4e3b7d),
(2, 22, 'WingTsun-Schule Remscheid-Lennep', 'Robert-Schumacher-Str. 6', 'Im Sportstudio Fit & Fun (über Rewe)', '42897', 'Remscheid', 'Remscheid-Lennep', '51.189055', '7.253708', 'Jeden Montag nach dem WingTsun: Selbstverteidigung mit und gegen Waffen. Fuer alle Teilnehmer des Erwachsenen WingTsun kostenlos!', 1, 3, 1, 0, 2, 6, 1, 3, 3, 3, 1458655705, 1458218192, 1, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, -1, 0, 0x613a32313a7b733a31363a227379735f6c616e67756167655f756964223b4e3b733a363a2268696464656e223b4e3b733a343a226e616d65223b4e3b733a373a2261646472657373223b4e3b733a31323a22616464726573735f696e666f223b4e3b733a383a22706f7374636f6465223b4e3b733a343a2263697479223b4e3b733a31303a22636974795f6c6162656c223b4e3b733a383a226c61746974756465223b4e3b733a393a226c6f6e676974756465223b4e3b733a343a22696e666f223b4e3b733a363a22616374697665223b4e3b733a373a2267616c6c657279223b4e3b733a31333a2270726f66696c655f696d616765223b4e3b733a32313a2261637469766174655f616c745f747261696e696e67223b4e3b733a353a226f776e6572223b4e3b733a373a22636f6e74616374223b4e3b733a373a22747261696e6572223b4e3b733a31303a2263617465676f72696573223b4e3b733a31333a22747261696e696e675f74696d65223b4e3b733a31373a22747261696e696e675f74696d655f616c74223b4e3b7d);

--
-- Indizes der exportierten Tabellen
--

--
-- Indizes für die Tabelle `tx_wtschools_domain_model_schools`
--
ALTER TABLE `tx_wtschools_domain_model_schools`
  ADD PRIMARY KEY (`uid`),
  ADD KEY `parent` (`pid`),
  ADD KEY `t3ver_oid` (`t3ver_oid`,`t3ver_wsid`),
  ADD KEY `language` (`l10n_parent`,`sys_language_uid`);

--
-- AUTO_INCREMENT für exportierte Tabellen
--

--
-- AUTO_INCREMENT für Tabelle `tx_wtschools_domain_model_schools`
--
ALTER TABLE `tx_wtschools_domain_model_schools`
  MODIFY `uid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

最佳答案 您的Powermail版本的手册
https://docs.typo3.org/typo3cms/extensions/powermail/2.24.0/ForAdministrators/GoodToKnow/PrefillField/Index.html显示了如何创建选择列表.示例3显示了如何从表中读取.在您的情况下,您可以使用name和uid(该字段将显示名称并存储uid的值).

要设置接收器,手册也有示例https://docs.typo3.org/typo3cms/extensions/powermail/2.24.0/ForAdministrators/GoodToKnow/DynamicReceiver/Index.html.在您的用例中,我将使用CONTENT查询而不是示例中的CASE,并查找所选uid的电子邮件地址.
确保使用CONTENT对象中的标记注入选定的uid以防止SQL注入!

点赞