I call my email template from my controller and send variables to it so I don't need to rewrite the entire template (header & footer) especially because they might change during time.

So, I'm using this function in my execute() controller :

$transport = $this->_transportBuilder
                        'area' => 'frontend',
                        'store' => $this->storeManager->getStore()->getId()
                    'email' => $email,
                    'result' => $this->resultText(
                ->addTo($email, $name)


Inside of it, I call my template with the id number from my BO :


I receive the email correctly except for the media. Those are stored in BO wysiwyg and are correctly displaying when I do the preview temmplate (they are called in the template, not in controller)

Is there something I need to know for it to work ?

1 Answer 1


Ok, so I found out that my project needs to be on a server for the immage to be displaying, even if they are stocked in admin backoffice wysiwyg, otherwise, any mail server will block them for security.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.