1

Possible Duplicate:
Send email of form data?

So I have a simple three field form which I've created in HTML/CSS, see here:

Simple email sign up form

Now I want to put this into a block module, generate the form fields using Drupal Form API (is this appropriate or should I just stick with my existing HTML markup?). And on submission of the form I want it to email the details to a designated email. Is Drupal Triggers appropriate for this, if not, what is?

Any guidance on where to go with this would be amazing. Thanks so much for your time :)

marked as duplicate by kiamlaluno Sep 17 '12 at 16:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

The easiest way is to create the form using webform module. This will also send an email to a chosen address. Unfortunately this will create just a normal page, not a block.

To show it in a block you'll need to create a view that renders the whole webform (which is a node) or to use mini panels with the same rendered node.

1

Use simple news module which will give you lots of e-newsletter features out of the box.

For new features you can extend above module to suit your specific requirements.

0

There are several approaches to this problem,

  • You can use "webform " module and theme it using $form[theme], your start can be here
  • you can use Form API to create a custom form. Your good start is FORM API Guide
  • To trigger a Mail on submission, you can use rules OR triggers OR just a submit function

Not the answer you're looking for? Browse other questions tagged or ask your own question.