Created
November 26, 2012 18:24
-
-
Save kraigh/4149764 to your computer and use it in GitHub Desktop.
Mortgage Contact Form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function circa_loan_calc_mortgage_partner_form_submit($form, &$form_state) { | |
$listing_path = isset($_GET['q']) ? $_GET['q'] : '<front>'; | |
$listing_link = url($listing_path, array('absolute' => TRUE)); | |
$send_form_to = '[email protected]'; | |
$params = array( | |
'context' => array( | |
'subject' => 'Request for mortgage info from user at circastl.com', | |
'body' => '<p>A user at circastl.com has requested mortgage pre-approval on a property.</p>' . '<p>Name: ' . $form['name'] . '</p><p>Email: ' . $form['email'] . '</p><br><p>Property: <a href="' . $listing_link . '">' . $listing_link . '</a></p><p>List Price: ' . $node->field_listing_price['und'][0]['value'] . '</p>', | |
), | |
'plaintext' => 'A user at circastl.com has requested mortgage pre-approval on a property. ' . 'Name: ' . $form['name'] . '. Email: ' . $form['email'] . '. Property: ' . $listing_link . '. List Price: ' . $node->field_listing_price['und'][0]['value'] . '.', | |
); | |
drupal_mail('mimemail', 'key', $send_form_to, language_default(), $params); | |
$display_message = 'Thank you for requesting pre-approval. You will be contacted shortly.'; | |
drupal_set_message($display_message); | |
exit('<script type="text/javascript">parent.location.reload();</script>'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment