fbpx

Stay Home & Grab 20% Discount COVID19Grab Now

Welcome, Guest
Username: Password: Remember me

TOPIC: (SOLVED)Define Email address based on form fields list

Define Email address based on form fields list 1 month 3 weeks ago #21145

  • fsiedler
  • fsiedler's Avatar
  • Offline
  • New Member
  • Posts: 3
  • Thank you received: 1
  • Karma: 0
Hello,

I want to build a more complex form with a list field, where the user can select an option. Based on this option, i would like to send the mail to a specified recipient. So i need behind every option a email address and when the form is submitted, the email address behind the list option should be taken as recipient.
Is this possible?

Thank you!
The topic has been locked.

Define Email address based on form fields list 1 month 3 weeks ago #21149

  • nishtha
  • nishtha's Avatar
  • Offline
  • Moderator
  • Posts: 843
  • Thank you received: 90
  • Karma: 12
Hi,

Well that a bit complex to incorporate within a Simple Contact Form, but let me just ask with the team.
Though not sure whether they'll agree or not but will see.

Thanks,
Nishtha
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.

To know more about products check out the their documentation.
The topic has been locked.

Define Email address based on form fields list 1 month 3 weeks ago #21252

  • hakana
  • hakana's Avatar
  • Offline
  • New Member
  • Posts: 16
  • Karma: 0
I would like to follow this topic too. I had to create a totally new field to achive this and modify the helper file indeed. So if you can update the module code accordingly, that would be even better for me. Because currently I cannot update my module.
The topic has been locked.

Define Email address based on form fields list 1 month 3 weeks ago #21258

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Posts: 3704
  • Thank you received: 543
  • Karma: 96
Hi,

This is something that's not possible with JD Simple contact form and we don't have plan to add this feather either. This is really a simple contact form.

Thank You,
Chetan
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.
The topic has been locked.

Define Email address based on form fields list 1 month 3 weeks ago #21272

  • fsiedler
  • fsiedler's Avatar
  • Offline
  • New Member
  • Posts: 3
  • Thank you received: 1
  • Karma: 0
Hi Chetan,

i agree with you, that a simple contact form should be simple ... I will implement my own logic and disable the module in the update process of joomla, like Hakana did.

Thank you,
Florian
The topic has been locked.

Define Email address based on form fields list 1 month 3 weeks ago #21286

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Posts: 3704
  • Thank you received: 543
  • Karma: 96
Good Luck Florian. Feel free to post your finished code back here if you like so it can be used for other's in the future.

Thank You,
Chetan
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.
The topic has been locked.

Define Email address based on form fields list 1 month 2 weeks ago #21311

  • fsiedler
  • fsiedler's Avatar
  • Offline
  • New Member
  • Posts: 3
  • Thank you received: 1
  • Karma: 0
I implemented not a generic solution for that purpose, because the recipients are really static and i decided to go the simple way with a fixed list of recipients.

  1. I added in the module in the to recipient field a static string like "[FSW: Conditional Recipient Selection]".
  2. My list contains the following Options: Nachricht an Christine, Nachricht an Karin, Nachricht an Sabrina
  3. The logic based on the list selection i implemented in the modules/mod_jdsimplecontactform/helper.php after Line 258 ...

// Recipient
$recipients = !empty($params->get('email_to', '')) ? $params->get('email_to') : $config->get('mailfrom');



/*
---
FSW Custom Recipeint Log
---
*/

if($recipients == '[FSW: Conditional Recipient Selection]') {
$recipient_list_selection = trim($values);

if($recipient_list_selection == 'Nachricht an Christine') {
$recipients = 'recipient1[at]xyz.de';
} else if($recipient_list_selection == 'Nachricht an Karin') {
$recipients = 'recipient2[at]xyz.de';
} else if($recipient_list_selection == 'Nachricht an Sabrina') {
$recipients = 'recipient3[at]xyz.de';
}
}

/*
---
End FSW Custom Recipeint Log
---
*/



$recipients = explode(',', $recipients);
if (!empty($recipients)) {
$mailer->addRecipient($recipients);
}
The topic has been locked.
The following user(s) said Thank You: akash

Define Email address based on form fields list 1 month 2 weeks ago #21336

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Posts: 3704
  • Thank you received: 543
  • Karma: 96
Case closed. Thank You!
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.
The topic has been locked.
Moderators: akash, chandandeep
Time to create page: 0.412 seconds