function makemeeting_sendfw_form_submit in Make Meeting Scheduler 7
Same name and namespace in other branches
- 6 makemeeting.module \makemeeting_sendfw_form_submit()
makemeeting_sendfw_form_submit()
Return value
void
File
- ./
makemeeting.module, line 1129 - Make Meeting module
Code
function makemeeting_sendfw_form_submit($form, &$form_state) {
// load node
$node_id = db_query("SELECT nid FROM {makemeeting_poll_heads} WHERE url = :url", array(
':url' => $form['#post']['sendfw']['poll_url'],
))
->fetchField();
$node = node_load($node_id);
// owner name
if ($node->uid == 0) {
$owner_name = $node->user_name == "" ? t("user") : $node->user_name;
}
else {
$account = user_load($node->uid);
$owner_name = $account->name;
}
// mail params
$mail_params = array(
"name" => t("user"),
"owner_name" => $owner_name,
"poll_url" => $node->poll_url,
);
// send emails
for ($i = 0; $i < 5; $i++) {
if (!empty($form['#post']['sendfw']['address_' . $i])) {
$email = $form['#post']['sendfw']['address_' . $i];
drupal_mail('makemeeting', 'refer', $email, language_default(), $mail_params);
}
}
drupal_set_message(t("Mail sent."));
}