title: October CMS - DynamicPDF plugin fails
body: <p>I've installed the DynamicPDf plugin by Renatio in order to generate PDF as attachment
  in emails.<br />
  But I can't get it to work.</p>
  <pre><code>use Renatio\DynamicPDF\Classes\PDF; // import facade
  
    ...
  
  $temp_file = tempnam(sys_get_temp_dir(), 'inv');
  PDF::loadTemplate('renatio::invoice')-&gt;save($temp_file);
  
  Mail::send('acme.blog::mail.welcome', $data, function ($message) {
      $message-&gt;attach($temp_file, ['as' =&gt; 'Your_Invoice.pdf']);
  });
  </code></pre>
  <p>I keep getting the same error</p>
  <blockquote>
  <p>No query results for model [Renatio\DynamicPDF\Models\Template]</p>
  </blockquote>
  <p>Can someone help me ?</p>
  <p>Update // Here's my code</p>
  <pre><code>&lt;?php namespace Codalia\Membership\Helpers;
  
  use October\Rain\Support\Traits\Singleton;
  use Renatio\DynamicPDF\Classes\PDF; // import facade
  use Codalia\Membership\Models\Member;
  
     ...
  
  class EmailHelper
  {
      use Singleton;
  
     ...
  
      public function payment($recordId, $data)
      {
          $member = Member::find($recordId);
          $vars = ['first_name' =&gt; $member-&gt;first_name,
                   'last_name' =&gt; $member-&gt;last_name,
                   'amount' =&gt; $data['amount'],
                   'item' =&gt; $data['item'],
                   'payment_mode' =&gt; $data['mode'],
          ];
  
          $temp_file = tempnam(sys_get_temp_dir(), 'inv');
          PDF::loadTemplate('renatio::invoice-membership', $vars)-&gt;save($temp_file);
  
          Mail::send('codalia.membership::mail.payment_email, $vars, function($message) use($member, $temp_file) {
              $message-&gt;to($member-&gt;email, 'Admin System');
              $message-&gt;subject(Lang::get('codalia.membership::lang.email.payment_subject));
              $message-&gt;attach($temp_file, ['as' =&gt; 'Your_Invoice.pdf']);
          });
        }
  
     ...
  
  }
  </code></pre>