I have developed a page for a client, and I have to do a newsletter. I already have the template of the mail and what I want is to insert a picture in those emails.
The code :
foreach($customer as $customer)
{
$mail = $customer->getMailcustomer();
$message = \Swift_Message::newInstance();
$message->setSubject('Info');
$message->setFrom('abcd@noreply.ch');
$message->setTo($mail);
$message->setContentType("text/html");
$message->setBody(
$this->renderView(
'MyBundle:Customer:email.html.twig',
array('form' => $form->createView())
)
);
$this->get('mailer')->send($message);
}
This code works and I have a nice email page but what I don't know is how to insert a picture in it.
I tried to insert a picture in the email.html.twig
but it didn't work.