Skip to content

The Mailer Documentation #11633

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
May 31, 2019
Merged

The Mailer Documentation #11633

merged 1 commit into from
May 31, 2019

Conversation

weaverryan
Copy link
Member

o/ friends!

Say hello to the Mailer documentation (#11626 does the component).

A lot of the docs were moved from the mime component, and pretty much everything here was tested. Reviews, questions and comments are warmly welcomed.

Note: the first commit was just to "deprecate" the Swift Mailer docs and copy the email/* docs into the one, deprecated Swift Mailer document (email.rst). Mailer lives in mailer.rst.

Cheers!

@OskarStark OskarStark added this to the 4.3 milestone May 30, 2019
Copy link
Member

@wouterj wouterj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice job! And I 😍 PHP 7+ code examples

The section talking about all twig filters (inky, etc) seems to me like it should be belong to a sub-guide (with a small reference section in the main guide that briefly mentions all integratable tools). You're often interested in just one and reading every single one seems a bit too much. Other than that major +1

->htmlTemplate('emails/signup.html.twig')
+ ->textTemplate('emails/signup.txt.twig')
// ...
;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe correct diff templates should indent all lines with 2 spaces, except from the ones containing + /- )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what I have is correct. Looking at other parts of the docs, a diff code block (at least the way I've been creating them) involves making a normal code block (with normal indentation) and then adding + or - (plus then space) on the changed lines. That indeed makes those lines look a little "funny" - as the changed lines don't line up with the unchanged lines inside the raw rst (but it renders correctly).

================== =============================================

Each library includes a :ref:`Flex recipe <flex-recipe>` that will add example configuration
to your ``.env`` file. For example, suppose you want to use SendGrid. First,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
to your ``.env`` file. For example, suppose you want to use SendGrid. First,
to the ``.env`` file. For example, suppose you want to use SendGrid. First,

Copy link
Contributor

@noniagriconomie noniagriconomie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice add, wanted to learn about it, PR doc is a good starting point :)

development. If you are using the SwiftmailerBundle with Symfony, you
can achieve this through configuration settings without having to make
any changes to your application's code at all. There are two main choices
when it comes to handling email during development: (a) disabling the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to create anchor for linked subtitle?


Now, suppose you're sending an email to ``recipient@example.com`` in a controller::

public function index($name, \Swift_Mailer $mailer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string $name ? :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, but this is just moved from another spot in the docs - we won't update Swiftmailer docs for php7 - just not worth it (well, at least not in this PR)


.. tip::

Alternatively, you can open the profiler after the redirect and search
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about adding this directly after the previous paragraph?
not as a tip, but as a two way options

personnaly i have never used intercept_redirects

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good note, but can you propose in a separate PR? This is just moved from a different part of the docs - i don't want to update anything in email.rst for this PR


When the text content of a ``TemplatedEmail`` is not explicitly defined, mailer
will generate it automatically by converting the HTML contents into text. If you
have `league/html-to-markdown`_ installed in your application,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool one

… many docs from mime to Mailer and writing it

Co-Authored-By: Wouter J <wouterj@users.noreply.github.com>
Co-Authored-By: Ricardo de Vries <ricardozegt@gmail.com>
Co-Authored-By: Antoine Makdessi <antoine.makdessi@me.com>
@weaverryan weaverryan merged commit c2e92a5 into symfony:4.3 May 31, 2019
weaverryan added a commit that referenced this pull request May 31, 2019
This PR was merged into the 4.3 branch.

Discussion
----------

The Mailer Documentation

o/ friends!

Say hello to the Mailer documentation (#11626 does the component).

A lot of the docs were moved from the mime component, and pretty much everything here was tested. Reviews, questions and comments are warmly welcomed.

Note: the first commit was just to "deprecate" the Swift Mailer docs and copy the `email/*` docs into the one, deprecated Swift Mailer document (`email.rst`). Mailer lives in `mailer.rst`.

Cheers!

Commits
-------

c2e92a5 deprecating Swift Mailer and moving all docs into one spot and moving many docs from mime to Mailer and writing it
@weaverryan
Copy link
Member Author

Thanks to everyone for the wonderful review - a lot of improvements and fixes came because of that!

@weaverryan weaverryan deleted the mailer branch May 31, 2019 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants