By himagarwal on
I want to use CCK for a contact form but I'm not getting how to email all the contents entered by user to sent to a specific email address and not to store it in database. Similarly to drupal core contact form but with extra advance fields.
There a great module called "webform" but as I only need one form in my website I think it's not worth using it since it also stores information in database.
Comments
I won't use CCK for this
I won't use CCK for this. As you pointed out all entries will be a new node. Then you will have to write your module to get the content mailed. Instead of writing your own mailing-module you can use the action and workflow module to deliver the emails. But then you will have to hope that there's a token available for the value you want to put in your mail.
I think the best way to go is to expand the build in contact form:
You will have to create your own module and implement two hooks:
form_alter and contact_page_submit.
With form_alter you can add your costum fields and with contact_page_submit you can pick-up those fields and process them.
Take a look at the contact_attach module (provides attachments for contactpage) and you can see how it is done.
*.-.*
Thanks clivesj,
I tried workflow module. I got your point that every cck field that I add in should have a token.
One question:, if I add multiple "text area filed" then how should I get token for them. And, I think this node type will also get saved in database. Do I also have to use action module with workflow?
I'm not into programming so I won't be able to create my own module with hook integration.
Webform though would be a
Webform though would be a more appropriate choice, CCK without some additional code is not designed for contact forms.
'*'_'*'
hmm...
Looks like I have to stick with webform module.
webform
If you are not into programming then WF is the way to go. The fact that is saves data into db should not be that big a problem I think.
You can even flush the table if you want.
in case someone also will be interested
How to do exactly this in drupal5:
http://blip.tv/file/451281
See some comments for the notes about drupal6, for example this one:
http://learn.awakenedvoice.com/2007/10/28/custom-drupal-contact-form/#co...
Create a new module
Your issue is fixed there.
http://drupal4u.in/create-contact-us-page-using-drupal-just-sending-emai...
Please check the link.