_rsvp_mail_rsvp($rid, $from = NULL, $resend = FALSE)
rsvp/rsvp.module, line 1664
$rid The rid of the rsvp.
| Name | Description |
|---|---|
| functions for rsvp mailing. |
<?php
function _rsvp_mail_rsvp($rid, $from = NULL, $resend = FALSE) {
$status['success'] = array();
$status['failed'] = array();
$attendees = _rsvp_get_attendees($rid);
while ($attendee = db_fetch_object($attendees)) {
if (!($resend && $attendee->received) && !($attendee->invited)) {
$invite = _rsvp_get_invite($attendee->hash);
if (rsvp_send_invitation($invite, $from)) {
db_query('UPDATE {rsvp_invite} SET invited = 1 WHERE hash = \'%s\'', $attendee->hash);
// hide e-mails for system users
$user = user_load(array('uid' => $attendee->uid));
$status['success'][] = ($user->uid == 0 ? $invite->email : $user->name);
}
else {
// hide e-mails for system users
$user = user_load(array('uid' => $attendee->uid));
$status['failed'][] = ($user->uid == 0 ? $invite->email : $user->name);
}
}
}
return $status;
}
?>