title: Wordpress - Read In HTML Email Template Stored In a File
body: <p>From my custom theme in Wordpress, I'd like to send an HTML email.</p>
  
  <p><strong>Rather than populating the body like this:</strong></p>
  
  <pre><code>$message = "";
  $message = "&lt;h3&gt;Someone has applied for a job on the site.&lt;/h3&gt;" . "&lt;br&gt;&lt;br&gt;";
  $message .= "Profile Picture URL: " . $Picture . "&lt;br&gt;";
  $message .= "Name: " . $Name . "&lt;br&gt;";
  $message .= "Email: " . $Email . "&lt;br&gt;";
  $message .= "Phone: " . $Phone . "&lt;br&gt;";
  $message .= "Work Phone: " . $WorkPhone . "&lt;br&gt;";
  $message .= "Resume: " . $Resume . "&lt;br&gt;";
  $message .= "Preferences: " . sanitize_text_field($Preferences) . "&lt;br&gt;&lt;br&gt;";
  </code></pre>
  
  <p><strong>Instead,</strong> I'd like the HTML email template to be it's own file.</p>
  
  <p>Then, I want to read in the HTML Email template file and populate parts of it with some data stored in php variables.</p>
  
  <p>So, let's say I have an html file:</p>
  
  <p><strong>emailtemplate.html</strong></p>
  
  <pre><code>&lt;h3&gt;Name: [NameGoesHere]&lt;/h3&gt;
  &lt;h3&gt;Address: [AddressGoesHere]&lt;/h3&gt;
  </code></pre>
  
  <p>Then, in my php file I have:</p>
  
  <pre><code>$name = "Jane Doe";
  $address = "123 Street";
  $message = "";
  wp_mail($to, $subject, $message, $headers, $attachments);
  </code></pre>
  
  <p>How do I read that html file in, put the name and address where it goes, and then store it in $message?</p>
  
  <p>My example seems too simple, but I've actually built 3 very thorough HTML emails that I want to use and it's a lot of code each.</p>
  
  <p>Thanks,</p>