-
- 21 Posts
How do you let the user select from a list of specified recipients?
Linux 2.6.32.8-grsec-2.1.14-modsign-xeon-64, PHP 5.2.14, MySQL 5.0.51a(client) 5.1.39-log (server), --with-pdo-mysql, Firefox/3.6.12
-
- 21 Posts
I figure I could put all the email addresses in a select drop down menu and then use the corresponding placeholder in the FormIt emailTo parameter. (similar to
http://modxcms.com/forums/index.php/topic,52334.msg307845.html#msg307845). But this still doesn’t obfuscate emails.
Do I have to write a custom hook for this?
Linux 2.6.32.8-grsec-2.1.14-modsign-xeon-64, PHP 5.2.14, MySQL 5.0.51a(client) 5.1.39-log (server), --with-pdo-mysql, Firefox/3.6.12
-
- 21 Posts
Vincent,
Thanks man. This looks like the solution. I’ll give this a go. Thanks again (I was beginning to think the lack of replies implied the solution didn’t require a custom hook).
Linux 2.6.32.8-grsec-2.1.14-modsign-xeon-64, PHP 5.2.14, MySQL 5.0.51a(client) 5.1.39-log (server), --with-pdo-mysql, Firefox/3.6.12
-
- 11 Posts
Hello
I have same problem.bt little bit different...I have to select email address according to zip code of city...i.e.Zip code will be given in different text box and according to i have to send email to particular person.
plz Reply..
Thanks,
Priyanka
-
- 21 Posts
Priyanka, you can use the same solution that Vincent offered.
If there are only a few zip codes from which to choose, you can list them in a select box. If you have many zip codes and listing them all becomes impractical, you’d still have to create an array of zip code keys to email address values, process the user’s input to remove white spaces, and unify capitalization etc, and return the correct value based on the user’s processed key.
Linux 2.6.32.8-grsec-2.1.14-modsign-xeon-64, PHP 5.2.14, MySQL 5.0.51a(client) 5.1.39-log (server), --with-pdo-mysql, Firefox/3.6.12
-
- 11 Posts
Hello
Thanks for reply
I have to select email address according to zip code from database..Can i assign multiple values to email address???with setvalue???
$userChoice = $hook->getValue(’zip’);
global $modx;
$sql = ("select ’email’ from `dealer` where `zip` = ’".$userChoice."’");
$result = $modx->db->query($sql);
if( $result != ’Null’ )
{
$hook->setValue(’emailAddresses’,$result);
}
return true;
I am using this code bt its not working
-
- 21 Posts
Hi Priyanka,
I don’t have much experience with custom db queries.
All I can recommend is to try running through the xPDO tutorials, the links to which
splittingred has listed already.
Linux 2.6.32.8-grsec-2.1.14-modsign-xeon-64, PHP 5.2.14, MySQL 5.0.51a(client) 5.1.39-log (server), --with-pdo-mysql, Firefox/3.6.12