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 . "rn";
    $message .= "<h1><strong>E-mail</strong></h1>: " . $fromEmail . "rn";
    $message .= "<p>" . $comments . "</p>";
    $message .= $bottom_of_body;
    $headers = "MIME-Version: 1.0" . "rn";
    $headers .= "Content-Type: text/html; charset=ISO-8859-1" . "rn";
    $headers .= "From: " . $fromEmail . "rn";
    $headers .= "Reply-To: " . $fromEmail . "rn";

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

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

replace 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


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x