Advanced Contact plugin

Advanced Contact plugin, a forum discussion on Jojo CMS. Join us for more discussions on Advanced Contact plugin on our Plugin Support forum.

Back to Forum Index : Back to Plugin Support   RSS
Jaijaz Jaijaz

13 Mar 2009
Posts: 215

I am wondering if there is any interest in an advanced contact plugin the lets you add a drop down choice of who the email is going to. I have to do it for a client and thought there might be some desire from the community for that feature.

Basically I plan on having it controled from the options fields. Or perhaps just add it to the current contact plugin so we aren't maintaining extra code?

Thoughts?

Jai
If you not living on the edge you taking up too much space.
tom

Developer

tom

13 Mar 2009
Posts: 379

sounds good to me - i'd rather it was an option off the standard contact plugin myself.

the only complication will be how you handle the various address options - i'd imagine that it'd require a contacts table so that you could have an address linked to a display name. or it might be less overhead to use the users table with an extra yes/no field for 'sitecontact', but which only gets checked if the option is switched on (a lot of effort going into reducing the number of sql queries from plugins at the moment)
Harvey

Core Developer

Harvey

13 Mar 2009
Posts: 327

Good idea.

I would implement this using the fields.php file that's sittign in the contact plugin. If the user wants to have multiple destinations, they can add another record to the fields file - just eneds to eb a 2D array, something like this...

$destinations = array('sales'=>'sales@domain.com', 'support'=>support@domain.com', 'management'=>'management@domain.com');

Assign the variable to Smarty, turn it into a dropdown list, and read the value when the form is submitted.

This is definitely better in the main contact plugin rather than having 2 plugins to deal with.

Cheers,

Harvey.
Jaijaz Jaijaz

14 Mar 2009
Posts: 215

I was using the fields.php file as the place where it could be turned on. My plan was to have some stuff in options to so the clients can have control over who and what addresses appear. Perhaps the whole thing could be controled in options.

My concern is extra database queries. Been looking at the Jojo::getOption() and Jojo::getOptions() functions. It look like getOptions is caching the data, does that mean when that everytime we check an option it should be using the cache or will it be clearing regularly and doing lots of queries?

Jai
If you not living on the edge you taking up too much space.
Rick Rick

14 Mar 2009
Posts: 336

Harvey said...
$destinations = array('sales'=>'sales@domain.com', 'support'=>support@domain.com', 'management'=>'management@domain.com');

Assign the variable to Smarty, turn it into a dropdown list, and read the value when the form is submitted.


But wouldn't that put the email addresses (I'm assuming not obfuscated) in the html where they could be scraped?

You could use a text area as an option field - one entry per line, pipe separating the display name from address... turn it into an array and use the indexes on the form then look them up on submission. You'll get issues if you change the option after someone loaded the form but before they submitted it though.
Rick Rick

14 Mar 2009
Posts: 336

Or... build a custom page for managing the contacts... it'd be almost exactly like the Redirects page :) CTRL+C and CTRL+V will set you free.
tom

Developer

tom

15 Mar 2009
Posts: 379

I'd go with Rick's version. Although it would be quicker to set up using fields.php, or something like a comma separated text field, i don't see any of our clients being able to use it comfortably.

and yes, options are cached, so there's no significant database overhead in using them (I asked Mike the same question a couple of days ago :)
Back to Forum Index : Back to Plugin Support   RSS
You must be logged in to post a reply



You need to Register or Log In before posting on these forums.