You are here

function invite_cancel_submit in Invite 6.2

Same name and namespace in other branches
  1. 5.2 invite.module \invite_cancel_submit()

Submit handler to delete an invitation.

File

./invite.module, line 1296
Allows your users to send and track invitations to join your site.

Code

function invite_cancel_submit($form, &$form_state) {
  $invite = $form_state['values']['invite'];
  db_query("UPDATE {invite} SET canceled = 1 WHERE reg_code = '%s'", $invite->reg_code);
  drupal_set_message(t('Invitation to %email has been withdrawn.', array(
    '%email' => $invite->email,
  )));

  // Notify other modules.
  $args = array(
    'inviter' => $invite->inviter,
    'email' => $invite->email,
    'code' => $invite->reg_code,
  );
  module_invoke_all('invite', 'cancel', $args);
}