Skip to content

Better explain the most common problems when testing emails #7115

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

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
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
Next Next commit
Better explain the most common problems when testing emails
  • Loading branch information
javiereguiluz committed Nov 5, 2016
commit 0e2e1930dc76f2e18ba708a086c55f016a6322f4
16 changes: 12 additions & 4 deletions email/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ Start with an easy controller action that sends an email::
return $this->render(...);
}

.. note::

Don't forget to enable the profiler as explained in :doc:`/testing/profiling`.

In your functional test, use the ``swiftmailer`` collector on the profiler
to get information about the messages sent on the previous request::

Expand Down Expand Up @@ -67,4 +63,16 @@ to get information about the messages sent on the previous request::
}
}

Troubleshooting
---------------

The email collector is only available when the profiler is enabled and collects
information, as explained in :doc:`/testing/profiling`.

If the action that sends the email redirects to another page (for example when
you send an email after a form is processed and before redirecting to another
page) make sure that the test client doesn't follow the redirects, as explained
Copy link
Member

Choose a reason for hiding this comment

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

missing comma after the closing parenthesis

in :doc:`/testing`. Otherwise, the collector will lose the original email when
Copy link
Member

Choose a reason for hiding this comment

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

I think the last sentence is a bit misleading. It's not that the collector loses the mail, but that you are just looking at the "wrong" profile after being redirected, right?

redirecting to the new page.

.. _`Swift Mailer`: http://swiftmailer.org/