Example #1
0
/**
 * Sends the invitation.
 *
 * Called by the Invite::sendInvite() method.
 *
 * @param Invite $invite
 *   The invitation to send.
 */
function hook_invite_send($invite)
{
    if (!empty($invite->type_details()->invite_sending_controller['my_module'])) {
        global $language;
        $entity = entity_metadata_wrapper('invite', $invite);
        $params = array('invite' => $invite, 'wrapper' => $entity);
        $from = $entity->inviter->mail->value();
        drupal_mail('my_module', 'invite', $entity->invitee->mail->value(), $language, $params, $from, TRUE);
    }
}