Php 更改电子邮件通知上的文本
我正在使用WordPress的RSVP插件,并对其进行了修改,以便它可以显示哪些客人被邀请参加哪些活动。当他们进入RSVP时,它会发送一封电子邮件,目前看起来如下:Php 更改电子邮件通知上的文本,php,email,wordpress,Php,Email,Wordpress,我正在使用WordPress的RSVP插件,并对其进行了修改,以便它可以显示哪些客人被邀请参加哪些活动。当他们进入RSVP时,它会发送一封电子邮件,目前看起来如下: if((get_option(OPTION_NOTIFY_ON_RSVP) == "Y") && (get_option(OPTION_NOTIFY_EMAIL) != "")) { $sql = "SELECT firstName, lastName, rsvpStatus FROM ".ATTENDEES
if((get_option(OPTION_NOTIFY_ON_RSVP) == "Y") && (get_option(OPTION_NOTIFY_EMAIL) != "")) {
$sql = "SELECT firstName, lastName, rsvpStatus FROM ".ATTENDEES_TABLE." WHERE id= ".$attendeeID;
$attendee = $wpdb->get_results($sql);
if(count($attendee) > 0) {
$body = "Hello, \r\n\r\n";
$body .= stripslashes($attendee[0]->firstName)." ".stripslashes($attendee[0]->lastName).
" has submitted their RSVP and has RSVP'd with '".$attendee[0]->rsvpStatus."'.";
wp_mail(get_option(OPTION_NOTIFY_EMAIL), "New RSVP Submission", $body);
}
}
在我的数据库中,我有一个名为rsvpEvent的字段,我希望它能够获取数据并向该事件显示此人的RSVP。我已尝试将此添加到其中:
if((get_option(OPTION_NOTIFY_ON_RSVP) == "Y") && (get_option(OPTION_NOTIFY_EMAIL) != "")) {
$sql = "SELECT firstName, lastName, rsvpStatus FROM ".ATTENDEES_TABLE." WHERE id= ".$attendeeID;
$attendee = $wpdb->get_results($sql);
if(count($attendee) > 0) {
$body = "Hello, \r\n\r\n";
$body .= stripslashes($attendee[0]->firstName)." ".stripslashes($attendee[0]->lastName).
"has been invited to '".$attendee[0]->rsvpEvent."'." "and has submitted their RSVP and has RSVP'd with '".$attendee[0]->rsvpStatus."'.";
wp_mail(get_option(OPTION_NOTIFY_EMAIL), "New RSVP Submission", $body);
}
}
但是它破坏了我的整个网站,有人能给我一些提示或提示我哪里出了问题吗?你没有从数据库中获得rsvpEvent字段 尝试将其添加到SELECT查询中,如中所示:
if((get_option(OPTION_NOTIFY_ON_RSVP) == "Y") && (get_option(OPTION_NOTIFY_EMAIL) != "")) {
$sql = "SELECT firstName, lastName, rsvpStatus, rsvpEvent FROM ".ATTENDEES_TABLE." WHERE id= ".$attendeeID;
$attendee = $wpdb->get_results($sql);
if(count($attendee) > 0) {
$body = "Hello, \r\n\r\n";
$body .= stripslashes($attendee[0]->firstName)." ".stripslashes($attendee[0]->lastName).
"has been invited to '".$attendee[0]->rsvpEvent."'." "and has submitted their RSVP and has RSVP'd with '".$attendee[0]->rsvpStatus."'.";
wp_mail(get_option(OPTION_NOTIFY_EMAIL), "New RSVP Submission", $body);
}
}
我的错误我忘了把它加进去(打在头上),是的,我已经尝试并上传了,但仍然出现了服务器错误:(使用a,在上传错误代码之前,你会看到语法错误。