Skip to content

[Mailer] Fix attachment changes #18765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions mailer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ result of rendering some template) or PHP resources::
File Attachments
~~~~~~~~~~~~~~~~

Use the ``addPart()`` method with a ``BodyFile`` to add files that exist on your file system::
Use the ``addPart()`` method with a ``File`` to add files that exist on your
file system::

use Symfony\Component\Mime\Part\DataPart;
use Symfony\Component\Mime\Part\File;
Expand All @@ -564,7 +565,8 @@ Use the ``addPart()`` method with a ``BodyFile`` to add files that exist on your
->addPart(new DataPart(new File('/path/to/documents/contract.doc'), 'Contract', 'application/msword'))
;

Alternatively you can attach contents from a stream by passing it directly to the ``DataPart`` ::
Alternatively you can attach contents from a stream by passing it directly to
the ``DataPart``::

$email = (new Email())
// ...
Expand All @@ -573,9 +575,9 @@ Alternatively you can attach contents from a stream by passing it directly to th

.. deprecated:: 6.2

In Symfony versions previous to 6.2, the methods ``attachFromPath()`` and
``attach()`` could be used to add attachments. These methods have been
deprecated and replaced with ``addPart()``.
In Symfony versions previous to 6.2, the method ``attachPart()`` could be
used to add attachments. This method has been deprecated and replaced
with ``addPart()``.

Embedding Images
~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -616,13 +618,8 @@ images inside the HTML contents::

.. versionadded:: 6.1

The support of embedded images as HTML backgrounds was introduced in Symfony 6.1.

.. deprecated:: 6.2

In Symfony versions previous to 6.2, the methods ``embedFromPath()`` and
``embed()`` could be used to embed images. These methods have been deprecated
and replaced with ``addPart()`` together with inline ``DataPart`` objects.
The support of embedded images as HTML backgrounds was introduced in Symfony
6.1.

.. _mailer-configure-email-globally:

Expand Down