1. Dashboard
  2. Articles
  3. Forum
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • More Options
  1. webEdition Forum
  2. Forum
  3. Deutschsprachiges Support Forum
  4. webEdition Templates erstellen (we:tags)

Formular mit unterschiedl. Empfängern

  • christobal
  • July 18, 2023 at 12:03 PM
1st Official Post
  • christobal
    Student
    Posts
    83
    • July 18, 2023 at 12:03 PM
    • #1

    Hallo aus Tirol,

    Ich hab ein Formular mit einer Bundesland-select. Je nach gewähltem Bundesland soll ein entsprechender Formular-Empfänger gewählt werden. Ich bekomms leider nicht hin?!

    So schaut der nicht funktionierende Code aus

    Code
    <we:form type="formmail" name="Mitteilung" method="post" recipient="\$Bundesland" ...>
    
    <select name="Bundesland">
    <option value="christoph@xxx.com">Burgenland</option>
    <option value="christoph@xxx.com">Kärnten</option>
    <option value="christoph@xxx.com">Niederösterreich</option>
    </select>
    ...
    </we:form>

    Bitte um zweckdienliche Hinweise und ein großes Danke!

    Christoph

    Christoph Kaspar

    BIG Detail, Kaspar & Sigl OG

    Riedgasse 8b

    A-6020 Innsbruck

    Tirol-Österreich

    bigdetail.com

  • coolworx
    Moderator
    Reactions Received
    3
    Posts
    46
    • July 18, 2023 at 12:25 PM
    • Official Post
    • #2

    Hallo Christoph,

    wenn Du als recipient eine globale Variable einsetzt, dann muss diese vorher auch global zur Verfügung stehen. Dein Ansatz scheint mir hier auch nicht der richtige zu sein.
    Ich würde ein normales Formular bauen und das ganze mit we:sendMail realisieren.

    Code
    <we:ifNotVarEmpty name="Absenden">
    <we:var type="request" name="Bundesland" to="global" nameto="Bundesland" prepareSQL="true" />
    
    
    <we:sendMail id="XX" recipient="\$Bundesland" from="\$eMailServer" reply="\$Email" subject="Supportformular" charset="UTF-8" mimetype="text/html" />
    
    
    <we:form method="post" name="support" id="self">
    
    
    <select name="Bundesland">
    <option value="christoph@xxx.com">Burgenland</option>
    <option value="christoph@xxx.com">Kärnten</option>
    <option value="christoph@xxx.com">Niederösterreich</option>
    </select>
    
    
    <input id="" class="" name="Absenden" type="submit" value="Senden">
    </we:form>
    </we:ifNotVarEmpty>
    Display More

    Viele Grüße
    Ulrich

    coolworx

    https://www.coolworx.de

    • Next Official Post
  • christobal
    Student
    Posts
    83
    • July 18, 2023 at 3:26 PM
    • #3

    Grüß Dich Ulrich,

    vielen Dank für die Hilfe, nur ich bekomme kein Mail.

    Ich habe noch ein <we:else /> eingebaut, weil sonst gar kein Formular angezeigt wird.

    So schaut der Code aus:

    Code
    <we:ifNotVarEmpty name="Absenden">
    
    <we:var type="request" name="Bundesland" to="global" nameto="Bundesland" prepareSQL="true" />
    
    <we:sendMail id="793" recipient="\$Bundesland" from="xxx@xxx.com" reply="xxx@xxx.com" subject="Mitteilung" charset="UTF-8" mimetype="text/html" />
    
    <we:else />
    
    <we:form method="post" name="support" id="self">
    
    <select name="Bundesland">
    <option selected>Auswahl...</option>
    <option value="xxx@xxx.com">Burgenland</option>
    <option value="xxx@xxx.com">Kärnten</option>
    <option value="xxx@xxx.com">Niederösterreich</option>
    <option value="3">-Oberösterreich</option>
    <option value="3">-Salzburg</option>
    <option value="3">-Steiermark</option>
    <option value="2">-Tirol</option>
    <option value="3">-Vorarlberg</option>
    <option value="3">-Wien</option>
    </select>
    </div>
    </div>
    
    <input id="absenden" name="Absenden" type="submit" class="btn btn-bd btn-lg" value="Senden">
    
    </we:form>
    </we:ifNotVarEmpty>
    Display More

    Christoph Kaspar

    BIG Detail, Kaspar & Sigl OG

    Riedgasse 8b

    A-6020 Innsbruck

    Tirol-Österreich

    bigdetail.com

  • coolworx
    Moderator
    Reactions Received
    3
    Posts
    46
    • July 18, 2023 at 3:58 PM
    • Official Post
    • #4

    Was sagt das Fehlerlog?
    Welche WE-Version?
    Hast Du sendmail oder smpt in den Einstellungen unter Email eingerichtet?

    Viele Grüße
    Ulrich

    coolworx

    https://www.coolworx.de

    • Previous Official Post
    • Next Official Post
  • coolworx
    Moderator
    Reactions Received
    3
    Posts
    46
    • July 18, 2023 at 4:02 PM
    • Official Post
    • #5

    Mir fällt gerade auf, es fehlt noch das Attribut formname

    Code
    <we:ifNotVarEmpty name="Abssenden" type="post" formname="support">

    sonst klappt das nicht.

    Viele Grüße
    Ulrich

    coolworx

    https://www.coolworx.de

    • Previous Official Post
  • christobal
    Student
    Posts
    83
    • October 19, 2023 at 5:06 PM
    • #6

    Jetzt hab ich das nochmals ausprobiert und mit ccrecipient hats dann funktioniert!

    Danke nochmals, Ulrich!

    Code
    <we:ifNotVarEmpty name="Absenden" type="post" formname="support">
    <we:var type="request" name="Bundesland" to="global" nameto="Bundesland" />
    <we:sendMail id="4358" subject="mehrere Empfänger" recipient="xxx@xxx.com" recipientCC="\$Bundesland" from="xxx@xxx.com" mimetype="text/html" />
    </we:ifNotVarEmpty>
    
    <we:form method="post" name="support" id="self">
    
    <p><select name="Bundesland" id="Bundesland">
    <option selected>Auswahl...</option>
    <option value="xxx@xxx.com">gmail</option>
    <option value="xxx@xxx.com">bigdetail</option>
    </select></p>
    
    <p><input type="email" name="email" id="email"></p>
    <p><input type="text" name="Vorname" id="Vorname"></p>
    <p><input type="text" name="Nachname" id="Nachname"></p>
    
    <p><input id="Absenden" name="Absenden" type="submit" value="Senden">
    
    <we:var type="request" name="email" to="global" nameto="recipientmail"/>
    <we:var type="request" name="Vorname" to="global" nameto="Vorname"/>
    <we:var type="request" name="Nachname" to="global" nameto="Nachname"/>
    
    </we:form>
    Display More

    Christoph Kaspar

    BIG Detail, Kaspar & Sigl OG

    Riedgasse 8b

    A-6020 Innsbruck

    Tirol-Österreich

    bigdetail.com

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!

Register Yourself Login

Donations

200.00 EUR

Donate now

Tags

  • formmail
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™