I have a block module that looks like this:
Created in the following way:
function VL_newsletter_signup_block_info() {
$blocks['my-block-id'] = array(
'info' => t('Enjoy Stories? - Newsletter Signup'),
);
return $blocks;
}
/**
* Implementation of hook_block_view().
*/
function VL_newsletter_signup_block_view($delta='') {
$block = array();
switch ($delta) {
case 'my-block-id':
//$block['subject'] = t('Block Name');
$block['content'] = VL_newsletter_signup_contents();
break;
}
return $block;
}
/**
* custom html block
* @return string
*/
function VL_newsletter_signup_contents() {
return '<div class="col4 stories nobile">
<h2>Enjoy stories?</h2>
<h3>Sign up to recieve regular news</h3>
<form>
<input type="text" name="first" placeholder="First name">
<input type="text" name="last" placeholder="Last name">
<input type="email" name="email" placeholder="Email" >
<input class="send" type="submit" name="submit">
</form>
</div>';
}
At the moment my form is static HTML as can be seen, but I plan to use Drupal Form API to render it. My question is: on pressing send, how can I email the form data to a designated admin email address. Can I use triggers somehow or is there another function in Drupal API that could achieve this?