Joomla 5 Notice

We are pleased to announce that as of January 29, 2024, all of our Joomla extensions are compatible with Joomla 5.

For all who are still updateing from Joomla 3 to Joomla 4: Joomla 4 Migration instructions are available here:

There is now a separate Documentation for Visforms for Joomla 4 and for Visforms for Joomla 5!

Forum

Visforms Subscription user can ask questions in our forum. Please log in with the relevant user first.
Everybody can access the forum for reading.

Please only ask 1 question per topic.

SQL select mailcc

More
1 year 10 months ago #8170 by kthiemig
SQL select mailcc was created by kthiemig
Hallo zusammen,
ich nutze sql getriebene Felder mit Optionslisten. In der Doku habe ich gefunden, dass man hier auch Aliase wie mail cc mitgeben kann. Das wäre noch eine Anforderung die ich umsetzen müsste. Leider finde ich nichts zum Syntax. Meine Versuche sind leider gescheitert.

Wie muss der Syntax aussehen?

Beispiel:
Code:
select CASE WHEN 'AntwortA' in ${input:sql-6} THEN 'Antwort1' WHEN 'AntwortB' in ${input:sql-6} THEN 'Antwort3' END as value, CASE WHEN 'AntwortA' in ${input:sql-6} THEN 'Antwort1' WHEN 'AntwortB' in ${input:sql-6} THEN 'Antwort3' END as label union all select CASE WHEN 'AntwortA' in ${input:sql-6} THEN 'Antwort2' WHEN 'AntwortB' in ${input:sql-6} THEN 'Antwort4' END as value, CASE WHEN 'AntwortA' in ${input:sql-6} THEN 'Antwort2' WHEN 'AntwortB' in ${input:sql-6} THEN 'Antwort4' END as label;
Wenn Antwort 1 ausgewählt wird, soll die Mail an mail1@test.de und bei Antwort3 an mail2@test.de

Danke für einen Tipp.

More
1 year 10 months ago - 1 year 10 months ago #8171 by Administrator IV
Replied by Administrator IV on topic SQL select mailcc
Hallo kthiemig,

ich habe dein SQL-Statement umformuliert, damit es übersichtlicher wird.
Es ist eine Alternative und kommt ganz ohne die schnell doch recht aufwendige 'CASE'-Konstruktion aus.

Es stammt offensichtlich aus deinem früheren Post:
vi-solutions.de/de/support/forum/19-joom...er-mehrfach-vergeben

Dieses SQL hat bei mir wie gewünscht funktioniert:
Code:
select 'Antwort1' as label, 'Antwort1' as value, 'mail1@test.de' as mail from dual where 'AntwortA' in ${input:sql-6} union select 'Antwort2' as label, 'Antwort2' as value, 'mail2@test.de' as mail from dual where 'AntwortA' in ${input:sql-6} union select 'Antwort3' as label, 'Antwort3' as value, 'mail3@test.de' as mail from dual where 'AntwortB' in ${input:sql-6} union select 'Antwort4' as label, 'Antwort4' as value, 'mail4@test.de' as mail from dual where 'AntwortB' in ${input:sql-6};

Wenn Antwort 1 ausgewählt wird, wird die Mail an mail1@test.de gesendet.
Wenn Antwort 2 ausgewählt wird, wird die Mail an mail2@test.de gesendet.
usw.

Zu dem Teil 'from dual' siehe hier (insbesondere die Antwort von SeparateReality):
stackoverflow.com/questions/33378732/wha...-alternative-to-dual

Du kannst in deinem SQL-Select-Statement diese Aliase verwenden: redirecturl, mail, mailcc und mailbcc.
Also etwa so:
Code:
select 'Antwort1' as label, 'Antwort1' as value, 'mail1@test.de' as mail, 'mail1_cc@test.de' as mailcc, 'mail1_bcc@test.de' as mailbcc from dual where 'AntwortB' in ${input:sql-6};

Bitte nicht vergessen:
- das Plugin 'Visforms - Individuelle E-Mail Adressen' aktivieren
- das E-Mail Versenden in der Formularkonfiguration konfigurieren
- das E-Mail Versenden in Joomla konfigurieren

Gruß, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).
Last edit: 1 year 10 months ago by Administrator IV.
The following user(s) said Thank You: MaliRaj

More
1 year 10 months ago #8172 by kthiemig
Replied by kthiemig on topic SQL select mailcc
Vielen Dank!

Funktioniert perfekt.

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum