Zum Inhalt springen

th_mailformplus + email an verschiedene Empfänger nach Auswahl Checkbox

Erstellt am 8. September 2009 · 4 Antworten · letzte Antwort am 9. September 2009

Tags: Frage

sguser ·

Hallo,
ich habe mit der th_mailformplus-Extension ein Formular erstellt.
Dabei kann der User über 3 Checkboxen auswählen wozu er Infos zugesendet haben möchte. Entsprechend wird die email weitergeleitet an einen andere email-Adresse des Empfängers. Das funktioniert soweit !

Allerdings ist es nicht möglich 2 Checkboxen anzuklicken, dann wird nur an die erste email-Adresse versendet. Ich wollte z.B. die Condition 1 und Condition 2 mit && verbinden, das funktioniert aber nicht. Weiss hier jemand weiter ?
Code:

[globalVar = GP:contact_to=Werbung]
plugin.tx_thmailformplus_pi1.default.email_to = info@mail.com
[globalVar = GP:contact_to=Merchandising]
plugin.tx_thmailformplus_pi1.default.email_to = info2@mail.com
[globalVar = GP:contact_to=Verwaltung]
plugin.tx_thmailformplus_pi1.default.email_to = info3@mail.com
[end]

Ich habe das [end] einmal hinter jede Condition gesetzt und dann mal nur ganz am Ende bzw. die Conditions mit && verbunden. Das funktioniert leider alles nicht.

gmf ·

Wenn du das Ganze mit Checkboxes realisiert, ist es entweder ein Checkbox-Array oder jede Checkbox hat einen anderen Namen.

Wenn als Array realisiert, ist contact_to ein Array. Die Überprüfung mit "=" ist also sinnlos.
Wenn nicht als Array, dann sollte das Feld nicht immer contact_to heißen.

Reinhard

sguser ·

Hallo Reinhard,

vielen Dank für deinen Beitrag. Ich hatte auch schon ausprobiert:
contact_to1=Werbung, contact_to2=Merchandising und contact_to3=Verwaltung. Das funktioniert auch wenn man nur eine Checkbox auswählt. Ab der Auswahl von 2 Checkboxen habe ich wieder das gleiche Problem, er nimmt nur den ersten angeklickten Wert.

Ich glaube inzwischen, es liegt nicht an der Condition selber, die wird akzeptiert sondern an dem "email_to"

plugin.tx_thmailformplus_pi1.default.email_to = info1@mail.com, info2@mail.com

es wird nur die erste email-Adresse angenommen - was ich nicht verstehe weil ja im Backend über die Flexforms eine Liste mit email-Empfänger eingegeben werden kann....

gmf ·

Auch im TS kann eine Liste von Adressen eingetragen werden.

Probiers mal so:

plugin.tx_thmailformplus_pi1.default.email_to.value = email@host.com,email2@host.com
sguser ·

Hallo,

vielen Dank für den Tipp ! mit dem value hat es zwar nicht geklappt aber ich habs jetzt raus, die [Condition]&&[Condition] muss nach der "normalen" Condition rein und nicht davor. Hier der Code für alle die das mal brauchen können:

#email an verschiedene Empfänger senden:
[globalVar = GP:contact_to=Werbung]
plugin.tx_thmailformplus_pi1.default.email_to = info[at]mail[dot]com
[globalVar = GP:contact_to=Merchandising]
plugin.tx_thmailformplus_pi1.default.email_to = info2[at]mail[dot]com
[globalVar = GP:contact_to=Verwaltung]
plugin.tx_thmailformplus_pi1.default.email_to = info3[at]mail[dot]com

[globalVar = GP:contact_to=Werbung]&&[globalVar = GP:contact_to=Merchandising]
plugin.tx_thmailformplus_pi1.default.email_to = info[at]mail[dot]com, info2@mail.com

[globalVar = GP:contact_to=Werbung]&&[globalVar = GP:contact_to=Merchandising]
&& [globalVar = GP:contact_to=Verwaltung]
plugin.tx_thmailformplus_pi1.default.email_to = info[at]mail[dot]com, info2@mail.com, info3@mail.com
[end]