title: Sendgrid dynamic template PHP
body: <p>I want to implement Sendgrid dynamic templates to a project i work on, and my problem is next:
  here is some code that work, and I receive an email with substituted -forename-</p>
  
  <pre><code>    $content = new Content('text/html', '-forename- SOME TEXT');
      $mail-&gt;addContent($content);
      $mail-&gt;setSubject("TEST");
      $mail-&gt;addSubstitution('-forename-', 'SOME Name');
  </code></pre>
  
  <p>so my email body looks like this "SOME Name SOME TEXT" </p>
  
  <p>Now I have the next piece of code that actually uses a template from sengrid that I created</p>
  
  <pre><code>        $mail-&gt;setTemplateId($template_id);
          $mail-&gt;addDynamicTemplateData("-forename-", 'SOME Name');
  </code></pre>
  
  <p>And text inside my template is next one 
  " -forename- SOME TEXT "
  So theoretically if template Id is correct I should receive on email the next body "SOME Name SOME TEXT" but instead I receive  -forename- SOME TEXT
  I also tried </p>
  
  <p><code>$mail-&gt;addSubstitution('-forename-', 'SOME Name');</code></p>
  
  <p>but the result is the same</p>
  
  <p>Email is sent with success but the variable is not substituted.</p>
  
  <p>Sorry if I made any grammatical mistakes, hopefully my question make sense</p>
  
  <p>Thanks</p>