Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 更改电子邮件通知上的文本_Php_Email_Wordpress - Fatal编程技术网

Php 更改电子邮件通知上的文本

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

我正在使用WordPress的RSVP插件,并对其进行了修改,以便它可以显示哪些客人被邀请参加哪些活动。当他们进入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 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,在上传错误代码之前,你会看到语法错误。