query from db and select mail from db

  • wegwb
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0

wegwb created the topic: query from db and select mail from db

Hi,
I have created a form with a dropdown for different recipients. I need a function behind, thats check the db for a value e.g qm-beauftragte/r (at this moment are 9 dropdown values) and if match this then choose the e-mail from this user for the form.
Has someone an idea/ or example for the code i need?
#236266
  • Posts: 2483
  • Karma: 86
  • Thank you received: 335

mihaela replied the topic: query from db and select mail from db

Hello,

Please take a look at this topic since here crosstec.org/en/forums/1-forums/125334-m...html?start=24#232442 it is explained how to make this work as you wanted.

Let me know whether you have managed to set it for your form.

Regards,

Mihaela
#236268
  • wegwb
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0

wegwb replied the topic: query from db and select mail from db

Hi thx but i thing its more difficult:
Ill try to show you:
First image shows the select-list that need different mail from the database per selected line

Inside the db the table __comprofiler check the column cb_funktion the value e.g for "Bundesbeauftragte/r" and if this value found pick the id. Now goto table __users
check the column id and if this found the id pick the assigned e-mail adress to fill the e-mail for the form under select-list names Bundesbeauftragte/r
And so obn for all others inside the select-list.


I hope the description was a bit better for understanding my "problem"?
#236307
Attachments:
  • Posts: 2483
  • Karma: 86
  • Thank you received: 335

mihaela replied the topic: query from db and select mail from db

Hello,

From what you have explained since there aren't so many options in the select list it seems that you could use this simpler solution also crosstec.org/en/support/online-documenta...ct-list-from-db.html .

That way you would have to write a loop that would make a query to database for each cb_funktion the value e.g for "Bundesbeauftragte/r" and set the email as option's value.
Then you would just need to check the "Mailback" checkbox and email would be sent to that address.

Other option, as suggested in my previous topic crosstec.org/en/forums/1-forums/125334-m...html?start=24#232442 would require only one query to the database since it would be run after the value is selected.
You would have to create an additional textfield which would then be filled in with the result of the database query. To send email to that address you would once more have to check "Mailback" checkbox in the Advanced properties.

Regards,

Mihaela
#236324
Moderators: ForumSupporttomeperica
Time to create page: 0.658 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here