# Kontaktformular - Kopie an Kunde

**URL:** <https://forum.shopware.com/t/kontaktformular-kopie-an-kunde/6958>\
**Category:** Shopware 3.5\
**Tags:** administration\
**Created:** [25. April 2012 um 14:21 UTC](https://forum.shopware.com/t/kontaktformular-kopie-an-kunde/6958 "2012-04-25T14:21:56Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ottscho](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@ottscho](https://forum.shopware.com/u/ottscho)\
**Post date:** [25. April 2012 um 14:21 UTC](https://forum.shopware.com/t/kontaktformular-kopie-an-kunde/6958/1 "2012-04-25T14:21:56Z")

</div>

Hallo, gibt es eine einfache Möglichkeit dem Kunden eine Kopie der Nachricht zu senden? Evtl. muss man im Backend nur einen Haken setzen und ich finde diesen nicht. Danke

---

<div class="post-metadata">

**Author:** ![ottscho](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@ottscho](https://forum.shopware.com/u/ottscho)\
**Post date:** [26. April 2012 um 08:05 UTC](https://forum.shopware.com/t/kontaktformular-kopie-an-kunde/6958/2 "2012-04-26T08:05:18Z")

</div>

Niemand eine Idee? Muss dazu wirklich programmiert werden?

---

<div class="post-metadata">

**Author:** ![SebastianKloepper](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sebastiankloepper/32/21435_2.png) [@SebastianKloepper](https://forum.shopware.com/u/SebastianKloepper)\
**Post date:** [26. April 2012 um 08:21 UTC](https://forum.shopware.com/t/kontaktformular-kopie-an-kunde/6958/3 "2012-04-26T08:21:58Z")

</div>

Hi, im Standard geht nur eine eMail an die hinterlegte eMail-Adresse.

---

<div class="post-metadata">

**Author:** ![ottscho](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@ottscho](https://forum.shopware.com/u/ottscho)\
**Post date:** [26. April 2012 um 08:29 UTC](https://forum.shopware.com/t/kontaktformular-kopie-an-kunde/6958/4 "2012-04-26T08:29:16Z")

</div>

Gibts einen einfachen Workaround, wie ich das auf die schnelle im Code löse? Eine Email an den Shopbetreiber + Eine Email-Kopie an den Kunden. (Ich habe mich bis jetzt noch nie mit dem Kontaktformular beschäftigt!)

---

<div class="post-metadata">

**Author:** ![SebastianKloepper](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sebastiankloepper/32/21435_2.png) [@SebastianKloepper](https://forum.shopware.com/u/SebastianKloepper)\
**Post date:** [26. April 2012 um 08:49 UTC](https://forum.shopware.com/t/kontaktformular-kopie-an-kunde/6958/5 "2012-04-26T08:49:11Z")

</div>

Hallo, nicht jedes Formular muss ja zwingend ein eMail-Feld haben. Man kann dieses aber einbauen und als Typ eMail auswählen. Das müsste dann ggf. einfach in der Datei engine/Shopware/Controllers/Frontend/Forms.php mit abfragen im Code unten. Der wird die eMail zusammengebaut.

---

<div class="post-metadata">

**Author:** ![ottscho](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@ottscho](https://forum.shopware.com/u/ottscho)\
**Post date:** [26. April 2012 um 09:56 UTC](https://forum.shopware.com/t/kontaktformular-kopie-an-kunde/6958/6 "2012-04-26T09:56:29Z")

</div>

Okay, nur die Frage wie ich bei der eMailer Methode einen zweiten Empfänger oder CC Empfänger eintrage. $mail-\>replyTo scheint es nicht zu sein. ` //eMail field available check foreach ($this-\>FormElements as $element) { if($element['typ'] == "email") { $post\_email = $this-\>Post[$element['id']]; $post\_email = trim($post\_email); } } if(!empty($post\_email)){ $mail-\>From = $post\_email; $mail-\>replyTo = $post\_email; }else{ $mail-\>From = Shopware()-\>Config()-\>Mail; } `

---

<div class="post-metadata">

**Author:** ![ottscho](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@ottscho](https://forum.shopware.com/u/ottscho)\
**Post date:** [26. April 2012 um 11:54 UTC](https://forum.shopware.com/t/kontaktformular-kopie-an-kunde/6958/7 "2012-04-26T11:54:28Z")

</div>

so funktionierts… ` $mail-\>AddAddress($content["email"], ""); if(!empty($post\_email)){ $mail-\>AddAddress($post\_email, ""); } `

---

<div class="post-metadata">

**Author:** ![cyberfuechsin](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@cyberfuechsin](https://forum.shopware.com/u/cyberfuechsin)\
**Post date:** [28. Dezember 2013 um 22:28 UTC](https://forum.shopware.com/t/kontaktformular-kopie-an-kunde/6958/8 "2013-12-28T22:28:24Z")

</div>

Hallo, kann mir nur bitte wer genau sagen was durch was ersetzt werden müsste? Vielen Dank LG Marina

---

<div class="post-metadata">

**Author:** ![hbri](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@hbri](https://forum.shopware.com/u/hbri)\
**Post date:** [22. Januar 2016 um 12:04 UTC](https://forum.shopware.com/t/kontaktformular-kopie-an-kunde/6958/9 "2016-01-22T12:04:16Z")

</div>

Bei mir funktioniert es auch nicht. Wie und wo genau werden die beiden Zeilen eingefügt? Wir haben auch folgendes erfolglos probiert: ` if (!empty($postEmail)) { $mail-\>From = $postEmail; //Neu Kopie an Kunde $mail-\>AddCC($postEmail, ""); `

---

<div class="post-metadata">

**Author:** ![hbri](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@hbri](https://forum.shopware.com/u/hbri)\
**Post date:** [25. Januar 2016 um 11:47 UTC](https://forum.shopware.com/t/kontaktformular-kopie-an-kunde/6958/10 "2016-01-25T11:47:46Z")

</div>

so funktioniert es bei mir (Shopware 4.3.4) Ich habe folgende Zeilen abgeändert: 1. $mail-\>AddBCC($postEmail, „“); 2. Auskommentiert: //$mail-\>ClearAddresses(); 3. $mail-\>From = Shopware()-\>Config()-\>Mail; Wenn man 3. nicht ändert bekommt der Kunde von sich selber eine Email. ` public function commitForm() { $mail = Shopware()-\>System()-\>sMailer; $template = Shopware()-\>Config()-\>Templates-\>sSUPPORT; $mail-\>IsHTML($template['ishtml']); //eMail field available check foreach ($this-\>\_elements as $element) { if ($element['typ'] == "email") { $postEmail = $this-\>\_postData[$element['id']]; $postEmail = trim($postEmail); } } if (!empty($postEmail)) { //Geändert von $postmail zu Shop Email $mail-\>From = Shopware()-\>Config()-\>Mail; //Neu Kopie an Kunde $mail-\>AddBCC($postEmail, ""); } else { $mail-\>From = Shopware()-\>Config()-\>Mail; } $content = $this-\>View()-\>sSupport; $mail-\>FromName = $mail-\>From; $mail-\>Subject = $content["email\_subject"]; $mail-\>Body = $content["email\_template"]; foreach ($this-\>\_postData as $key =\> $value) { if ($this-\>\_elements[$key]['typ'] == "text2") { $names = explode(";", $this-\>\_elements[$key]['name']); $mail-\>Body = str\_replace("{sVars." . $names[0] . "}", $value[0], $mail-\>Body); $mail-\>Body = str\_replace("{sVars." . $names[1] . "}", $value[1], $mail-\>Body); } else { $mail-\>Body = str\_replace("{sVars." . $this-\>\_elements[$key]['name'] . "}", $value, $mail-\>Body); } } $mail-\>Body = str\_replace("{sIP}", $\_SERVER['REMOTE\_ADDR'], $mail-\>Body); $mail-\>Body = str\_replace("{sDateTime}", date("d.m.Y h:i:s"), $mail-\>Body); $mail-\>Body = str\_replace('{$sShopname}', Shopware()-\>Config()-\>shopName, $mail-\>Body); $mail-\>Body = strip\_tags($mail-\>Body); //Auskommentiert da sonst keine CC BCC Mail //$mail-\>ClearAddresses(); Unterdrückt alles $mail-\>AddAddress($content["email"], ""); $mail = Enlight()-\>Events()-\>filter('Shopware\_Controllers\_Frontend\_Forms\_commitForm\_Mail', $mail, array('subject' =\> $this)); if (!$mail-\>Send()) { throw new Enlight\_Exception("Could not send mail"); } } `

---

<div class="post-metadata">

**Author:** ![Andrew](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Andrew](https://forum.shopware.com/u/Andrew)\
**Post date:** [6. Februar 2016 um 14:13 UTC](https://forum.shopware.com/t/kontaktformular-kopie-an-kunde/6958/11 "2016-02-06T14:13:59Z")

</div>

Danke für den Code, klappt wunderbar.

Ich habe nur Angst wegen der Update-Unsicherheit. Gibt es hierzu eine Möglichkeit das Ganze sicher zu gestalten?

---

<div class="post-metadata">

**Author:** ![Skatch](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@Skatch](https://forum.shopware.com/u/Skatch)\
**Post date:** [23. März 2016 um 18:58 UTC](https://forum.shopware.com/t/kontaktformular-kopie-an-kunde/6958/12 "2016-03-23T18:58:58Z")

</div>

Habe von meinem Kunden den Auftrag erhalten, dass eine Kopie des Kontaktformular-Inhaltes an den Kunden rausgehen soll.&nbsp;

Habe es durch Einfügen der Zeile&nbsp;

```
$mail->addBcc($postEmail);

```

in der forms.php Zeile 310&nbsp;gelöst. (Version 5.1.4)&nbsp;

Der gesamte Absatz sieht nun so aus:&nbsp;

```
        $mail->setFrom(Shopware()->Config()->Mail);
        $mail->clearRecipients();
        $mail->addTo($content["email"]);
		$mail->addBcc($postEmail);
        $mail->setBodyText($mailBody);
        $mail->setSubject($content["email_subject"]);

```

(Habe es hier an den alten Beitrag angehängt, da dieser immer wieder auch in aktuellen Beiträgen verlinkt wird)
