Franz Holzinger

Verse of the day

Denn es ist ein Gott und ein Mittler zwischen Gott und den Menschen, nämlich der Mensch Christus Jesus, der sich selbst gegeben hat für alle zur Erlösung, daß solches zu seiner Zeit gepredigt würde;
1 Timotheus 2:5-6

© Bible Gateway's Verse of the Day


autor  
28-10-18 00:45:43 Bestellbestätigungsmails - plaintext, Lieferadresse
Florian Sauer
Hallo Herr Holzinger,

tt_products V 2.9.3

1. Wie kann ich an den Besteller zwar eine HTML-Bestellbestätigungsmail senden, an den Shopbetreiber jedoch nur eine Plaintext-Mail?

2. Wie kann ich für dem HTML-Content der Bestellbestätigungsmail an den Shopbetreiber ein anderes Template als das für den Besteller verwenden? Soweit ich sehe, gibt es für beide nur das BASKET_ORDERCONFIRMATION_TEMPLATE.

3. Wie kann ich im Falle von identischer Rechnungs- und Lieferadresse die Lieferadresse in den Bestellbestätigungsmails komplett unterdrücken und dafür statt dem Wort "Zahlungsadresse" das Wort "Zahlungs- und Lieferadresse" einsetzen?

Vielen Dank im Voraus für Ihre Hilfe!

14-11-18 16:00:35 verschiedene Bestellbestätigungen
Franz Holzinger
Für den Shop Betreiber kann man statt des üblichen Template Subparts OrderConfirmation auch den Subpart ###EMAIL_PLAINTEXT_TEMPLATE_SHOP### für eine Plaintext-E-Mail und den Subpart ###EMAIL_HTML_TEMPLATE_SHOP### für die HTML E-Mail setzen. Wenn letzterer leer ist, dann wird nur eine Plaintext-E-Mail verschickt.
Siehe die Seite https://wiki.typo3.org/Tt_products_marker .

Es gibt in tt_products 3.0.0 neue Subpart Marker, die man innerhalb von diversen Basket-Template Subparts einfügen kann:


###BILLING_EQUALS_SHIPPING### .. Wenn die Rechnungs- der Lieferanschrift entspricht.

<!-- ###BILLING_EQUALS_SHIPPING### begin -->
###P_BILLING_IS_SHIPPING###
<!-- ###BILLING_EQUALS_SHIPPING### end -->

<!-- ###BILLING_EQUALS_NOT_SHIPPING### begin -->
<!-- ###BILLING_EQUALS_NOT_SHIPPING### end -->

15-11-18 00:14:45 verschiedene Bestellbestätigungen
Florian Sauer
Vielen Dank für die Hinweise!

Leider funktioniert das so nicht:

Wenn ###EMAIL_HTML_TEMPLATE_SHOP### leer ist, wird immer noch ein HTML-Code generiert, weil das Template products_css_variants_de zunächst EMAIL_HTML_SHELL rendert. Damit erhalte ich für den Shopbetreiber eine HTML-Mail mit leerem Inhalt (das zugehörige Plaintext-Template EMAIL_PLAINTEXT_TEMPLATE_SHOP habe ich erstellt!)
17-11-18 23:21:34 Korrektur
Franz Holzinger
Mit dieser Korrektur sollte es funktionieren:

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


diff --git a/control/class.tx_ttproducts_activity_finalize.php b/control/class.tx_ttproducts_activity_finalize.php
index ab098b3..beecc3e 100755
--- a/control/class.tx_ttproducts_activity_finalize.php
+++ b/control/class.tx_ttproducts_activity_finalize.php
@@ -466,18 +466,18 @@ class tx_ttproducts_activity_finalize {
$emailControlArray['customer']['none']['recipient'] = array_merge($emailControlArray['customer']['none']['recipient'], $emailControlArray['shop']['none']['recipient']);
$emailControlArray['customer']['none']['recipient'] = array_unique($emailControlArray['customer']['none']['recipient']);
}
- $HTMLmailContent = '';
+ $customerHTMLmailContent = '';
$posEmailPlaintext = strpos($templateCode, $emailControlArray['customer']['none']['template']);

if ($posEmailPlaintext !== false || $this->conf['orderEmail_htmlmail']) {

if ($this->conf['orderEmail_htmlmail']) { // If htmlmail lib is included, then generate a nice HTML-email
$HTMLmailShell = $this->pibase->cObj->getSubpart($templateCode, '###EMAIL_HTML_SHELL###');
- $HTMLmailContent = $this->pibase->cObj->substituteMarker($HTMLmailShell, '###HTML_BODY###', $customerEmailHTML);
+ $customerHTMLmailContent = $this->pibase->cObj->substituteMarker($HTMLmailShell, '###HTML_BODY###', $customerEmailHTML);

- $HTMLmailContent =
+ $customerHTMLmailContent =
$this->pibase->cObj->substituteMarkerArray(
- $HTMLmailContent,
+ $customerHTMLmailContent,
$markerArray
);

@@ -485,7 +485,7 @@ class tx_ttproducts_activity_finalize {
if ($this->conf['orderEmail_htmlmail.']['removeImagesWithPrefix']) {

$parser = tx_div2007_core::newHtmlParser();
- $htmlMailParts = $parser->splitTags('img', $HTMLmailContent);
+ $htmlMailParts = $parser->splitTags('img', $customerHTMLmailContent);

foreach($htmlMailParts as $kkk => $vvv) {
if ($kkk%2) {
@@ -495,7 +495,7 @@ class tx_ttproducts_activity_finalize {
}
}
}
- $HTMLmailContent = implode('', $htmlMailParts);
+ $customerHTMLmailContent = implode('', $htmlMailParts);
}
} else { // ... else just plain text...
// nothing to initialize
@@ -628,14 +628,18 @@ class tx_ttproducts_activity_finalize {
$textContent
);
$subject = ($suffixControlArray['subject'] != '' ? $suffixControlArray['subject'] : $subject);
+ $HTMLmailContent = '';

- $HTMLmailContent = $this->pibase->cObj->substituteMarker($HTMLmailShell, '###HTML_BODY###', $basketHtml);
+ if ($basketHtml != '') {
+ $HTMLmailContent = $this->pibase->cObj->substituteMarker($HTMLmailShell, '###HTML_BODY###', $basketHtml);
+
+ $HTMLmailContent =
+ $this->pibase->cObj->substituteMarkerArray(
+ $HTMLmailContent,
+ $markerArray
+ );
+ }

- $HTMLmailContent =
- $this->pibase->cObj->substituteMarkerArray(
- $HTMLmailContent,
- $markerArray
- );
$fromArray = array();

if (
@@ -723,6 +727,7 @@ class tx_ttproducts_activity_finalize {
$markerArray
);

+ $HTMLmailContent = $customerHTMLmailContent;
if ($this->conf['orderEmail_htmlmail']) {
$reducedBasketHtml =
trim (
@@ -741,21 +746,23 @@ class tx_ttproducts_activity_finalize {
)
);

- $HTMLmailContent =
- $this->pibase->cObj->substituteMarker(
- $HTMLmailShell,
- '###HTML_BODY###',
- $reducedBasketHtml
- );
-
- $HTMLmailContent =
- $this->pibase->cObj->substituteMarkerArray(
- $HTMLmailContent,
- $markerArray
- );
- } else {
- $HTMLmailContent = '';
- }
+ if ($reducedBasketHtml != '') {
+ $HTMLmailContent =
+ $this->pibase->cObj->substituteMarker(
+ $HTMLmailShell,
+ '###HTML_BODY###',
+ $reducedBasketHtml
+ );
+
+ $HTMLmailContent =
+ $this->pibase->cObj->substituteMarkerArray(
+ $HTMLmailContent,
+ $markerArray
+ );
+ }
+ } else {
+ $HTMLmailContent = '';
+ }

tx_ttproducts_email_div::send_mail(
$conf['email'],
@@ -779,7 +786,7 @@ class tx_ttproducts_activity_finalize {
$recipient,
$apostrophe . $emailControlArray['radio1']['none']['subject'] . $apostrophe,
$emailControlArray['radio1']['none']['plaintext'],
- $HTMLmailContent,
+ $customerHTMLmailContent,
$emailControlArray['shop']['none']['from']['email'],
$emailControlArray['shop']['none']['from']['name'],
$emailControlArray['radio1']['none']['attachmentFile'],
19-11-18 17:52:46 erneute Korrektur
Franz Holzinger
siehe

https://github.com/franzholz/tt_products/commit/cfc6f73d9f3e4a3bdf8391c436c52b3923c77986
15-05-19 22:52:21 Dank
Florian Sauer
Spät, aber umso herzlicher meinen Dank für den Patch, den Sie zur Verfügung gestellt haben!
Funktioniert nun bestens.
< Zurück zum Forum