Hi all,

Working on my first Drupal site and was wondering if the next thing is possible;

I want to create a contact form which based on a selection made in the form (select/option box) will be send to a certain address. For instance, a visitor can enter his contact information and question and select to what department this email should be send ie. sales/helpdesk/administration. Is this possible at all? It probably would be if you hardcoded the receipients addresses into an select/option box but we don't want to scatter our email addresses all over our sopurce code now do we :)

Hope anyone can point me in the right direction!

Regards

Comments

BrianKlinger’s picture

Have you looked at using the contact module that comes with Drupal? It allows you to have a drop
down box with names of recipients and it also allows you to choose a default recipient.

bartezz’s picture

Hi Brian,

Well I must be overlooking something... or maybe that's because I'm on 5.7 and that option you are mentioning just isn't there?
If so please tell me how to go about this!

Cheers

________________
Live fast die young

BrianKlinger’s picture

No, I am also on 5.7. It is a core optional module called "Contact".

Go to admin/build/modules and you will find it there. Check it to enable it and then go to the administration page to use it.

bartezz’s picture

Well I'm afraid I just don't get it then...

Within 'site building' / 'contact form' I clicked 'add category',
named it 'feedback' and added multiple receipients and change 'selected' to yes.

Now when I go to the contact form; ziltch nothing nada!

Please enlighten me :)

________________
Live fast die young

BrianKlinger’s picture

A few things come to mind...

When you say you go to the contact form, do you mean that you go to yoursite.com/contact?
Are you user 1? If not, are user permissions (in Access Control) set up so that you are allowed to see the site-wide contact page?
Did you name ANOTHER page contact and they are now conflicting?
Do you see a menu choice for the contact form?

bartezz’s picture

Hey Brian,

Yes I'm user 1 with full permissions...
I've edited the contact form here: admin/build/contact/

But I don't think the core contact form can do what I want to do!
And am thinking I've explained it wrong to begin with... or you understood wrong :p

Let's say a visitor passes by my website and decides to drop a message.

He/she clicks 'contact us' fills in his/her name, email adrress and message.
But besides these input fields the form also displays where the message should be sent to via a dropdown menu.
This could be 'webmaster' / 'helpdesk' / 'sales' / 'adminsitartion'
From the selectbox the visitor selects 'webmaster'.
Now when the from gets submitted the system checks which email address belongs to webmaster and sends to message to this address.

Et voila...

You reckon this is possible?

________________
Live fast die young

BrianKlinger’s picture

Oh! Yeah, the terminology isn't necessarily the clearest. 'webmaster' is the category! So when you add a category 'webmaster', you can put all the email addresses you want a message sent to when someone chooses 'webmaster'. 'helpdesk' would also be a category, with multiple email possibilities (or just 1 email.) I hope that clears things up. You want to 'add category' for every TYPE of email account you want to set up.

bartezz’s picture

Hey Brian,

Thanx a billion for your patience! :)

I finally managed to do what I set out to do!
I've created the categories I mentioned and set the email address per category.

Now when I go to website.com/contact I see the dropdown list with the categories to pick from! Cool stuff :p

I see that there is no way to add extra fields to the form with the core module.
From what I've been reading I'll be needing webform.module for this or do you have any recommendations?

Cheers

________________
Live fast die young

BrianKlinger’s picture

webform module is ABSOLUTELY what you want to use if you want to have extra fields, etc. I've used webform module on every website I've built and it lives up to the hype and then some.

Oh, and by the way, I'm glad to help! Anything to continue helping people understand what an amazing product Drupal is and help them fulfill their purposes with Drupal.

bartezz’s picture

Hey Brian,

Well webform is kinda cool.... yet one thing def sucks!!!

I've posted it here:
http://drupal.org/node/275297

Cheers

________________
Live fast die young