FriendsOfSymfony / FOSUserBundle

Provides user management for your Symfony project. Compatible with Doctrine ORM & ODM, and custom storages.
https://symfony.com/doc/master/bundles/FOSUserBundle/index.html
MIT License
3.25k stars 1.57k forks source link

Insert image to registration mail? #1071

Open EricClapton opened 11 years ago

EricClapton commented 11 years ago

Hello good people from FOSUB and all the rest!

I have a question regarding inserting images into the confirm registration mail, eg. company logo image. I have created .html.twig with header and footer with images, but only the style and css are transfered, images not.

{% block body_html %}
{#
    You can of course render the html directly here.
    Including a template as done here allows keeping things DRY by using
    the template inheritance in it
    {% include 'AcmeDemoBundle:User:resetting_email.html.twig' %}
#}
###########################
solution?
###########################
{% autoescape false %}

{% endautoescape %}
{% endblock %}
Baachi commented 11 years ago

If you use swiftmailer look at this site http://swiftmailer.org/docs/messages.html#embedding-inline-media-files.

EricClapton commented 11 years ago

Yes, thanks. But i was wondering how to set

$message->embed(Swift_Image::fromPath('image.png'))

when i am already positioned inside the message body, if you see above code, that is where FOSUB left palce for html message.

could i use $this->embed() ?