admin管理员组文章数量:1288020
I am trying to make a email template for my wordpress site. So I tried to include the HTML mockup that was given to me, but instead of putting it directly on the same file, I would like to include() instead. Here is what my code looks like that's returning the error.
include(get_template_directory_uri() . '/inc/email_templates/quote.php');
$message = $top_of_body;
$message .= "<h1><strong>Name</strong></h1>: " . $name . "\r\n";
$message .= "<h1><strong>E-mail</strong></h1>: " . $fromEmail . "\r\n";
$message .= "<p>" . $comments . "</p>";
$message .= $bottom_of_body;
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1" . "\r\n";
$headers .= "From: " . $fromEmail . "\r\n";
$headers .= "Reply-To: " . $fromEmail . "\r\n";
I tested doing the HTML for email in the same file and it works, so the problem only occurs on the include. How do I "enable" this feature?
This is my error Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
I am trying to make a email template for my wordpress site. So I tried to include the HTML mockup that was given to me, but instead of putting it directly on the same file, I would like to include() instead. Here is what my code looks like that's returning the error.
include(get_template_directory_uri() . '/inc/email_templates/quote.php');
$message = $top_of_body;
$message .= "<h1><strong>Name</strong></h1>: " . $name . "\r\n";
$message .= "<h1><strong>E-mail</strong></h1>: " . $fromEmail . "\r\n";
$message .= "<p>" . $comments . "</p>";
$message .= $bottom_of_body;
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1" . "\r\n";
$headers .= "From: " . $fromEmail . "\r\n";
$headers .= "Reply-To: " . $fromEmail . "\r\n";
I tested doing the HTML for email in the same file and it works, so the problem only occurs on the include. How do I "enable" this feature?
This is my error Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
Share Improve this question asked Oct 2, 2020 at 20:37 davidb3rndavidb3rn 72 silver badges4 bronze badges 1 |1 Answer
Reset to default 5replace the first line on this
include(get_template_directory() . '/inc/email_templates/quote.php');
when accessing a file, use the absolute path, not the uri
本文标签:
版权声明:本文标题:plugin development - Warning: include(): https: wrapper is disabled in the server configuration by allow_url_include=0 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741335643a2373023.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
get_template_directory_uri
is for retrieving a URL not a folder path to the template directory, though that still leaves the problem that it will echo rather than return the content – Tom J Nowell ♦ Commented Oct 2, 2020 at 21:01