title: Embedding an image in email's body using $this->templating->render()
body: <p>I'm using the next code inside a method to send one kind of email:</p>
  
  <pre><code>    $message = \Swift_Message::newInstance('smtp.gmail.com', 465, 'ssl')
          -&gt;setSubject($this-&gt;translator-&gt;trans("Invitación a la comunidad %community%", array(
              '%community%' =&gt; $community-&gt;getNiceName()
          )))
          -&gt;setFrom('manolez@gmail.com', 'contact') // TODO DRY
          -&gt;setTo($email)
          -&gt;setReplyTo($inviter-&gt;getEmail(), $inviter-&gt;getFullName())
          -&gt;setContentType('text/html')
          -&gt;setBody($this-&gt;templating-&gt;render(
              'ProInvitationsBundle:Invitations:inviteEmail.html.twig',
              array('community' =&gt; $community, 'inviter' =&gt; $inviter)));
  </code></pre>
  
  <p>I want to embed an image to the body, so I could do:</p>
  
  <pre><code>    $message = \Swift_Message::newInstance('smtp.gmail.com', 465, 'ssl')
          -&gt;setSubject($this-&gt;translator-&gt;trans("Invitación a la comunidad %community%", array(
              '%community%' =&gt; $community-&gt;getNiceName()
          )))
          -&gt;setFrom('manolez@gmail.com', 'contact') // TODO DRY
          -&gt;setTo($email)
          -&gt;setReplyTo($inviter-&gt;getEmail(), $inviter-&gt;getFullName())
          -&gt;setContentType('text/html')
          -&gt;setBody('&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Here is an image &lt;img src="' .
               $message-&gt;embed(Swift_Image::fromPath('http://site.tld/logo.png')) .
           '" alt="Image" /&gt;' .
           '  Rest of message' .
           ' &lt;/body&gt;&lt;/html&gt;');
  </code></pre>
  
  <p>but in this way, the <code>$message</code> is not defined yet, and also I can't render my template. Any idea of how to achieve to embed an image to my defined template?</p>