From 0e2e1930dc76f2e18ba708a086c55f016a6322f4 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 5 Nov 2016 12:51:59 +0100 Subject: [PATCH 1/6] Better explain the most common problems when testing emails --- email/testing.rst | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/email/testing.rst b/email/testing.rst index 45b45350d77..2f2ffe893a8 100644 --- a/email/testing.rst +++ b/email/testing.rst @@ -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:: @@ -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 +in :doc:`/testing`. Otherwise, the collector will lose the original email when +redirecting to the new page. + .. _`Swift Mailer`: http://swiftmailer.org/ From 39b2f0e1a3bfa094f6240dff0d34ca68b2d761cc Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 5 Nov 2016 13:03:43 +0100 Subject: [PATCH 2/6] Fixed a minor typo --- email/testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/email/testing.rst b/email/testing.rst index 2f2ffe893a8..6a19c233deb 100644 --- a/email/testing.rst +++ b/email/testing.rst @@ -71,7 +71,7 @@ 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 +page), make sure that the test client doesn't follow the redirects, as explained in :doc:`/testing`. Otherwise, the collector will lose the original email when redirecting to the new page. From 0c4de6e1a839ce47a66f290dc9f71a76dd0dd584 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 5 Nov 2016 16:00:45 +0100 Subject: [PATCH 3/6] Reworded the explanation about emails and redirections --- email/testing.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/email/testing.rst b/email/testing.rst index 6a19c233deb..1c1e1f6ee3a 100644 --- a/email/testing.rst +++ b/email/testing.rst @@ -69,10 +69,10 @@ 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 -in :doc:`/testing`. Otherwise, the collector will lose the original email when -redirecting to the new page. +If a redirection is performed after sending the email (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 in +:doc:`/testing`. Otherwise, the collector will contain the information of the +redirected page and the email won't be accessible. .. _`Swift Mailer`: http://swiftmailer.org/ From 0388d9e006ca2b5f0691e979e37b7f16d2123224 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 7 Nov 2016 12:06:31 +0100 Subject: [PATCH 4/6] Added subtitles in the Troubleshooting section --- email/testing.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/email/testing.rst b/email/testing.rst index 1c1e1f6ee3a..d754f692c8b 100644 --- a/email/testing.rst +++ b/email/testing.rst @@ -66,9 +66,15 @@ to get information about the messages sent on the previous request:: Troubleshooting --------------- +Problem: The mail collector returns `null` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + The email collector is only available when the profiler is enabled and collects information, as explained in :doc:`/testing/profiling`. +Problem: The collector doesn't contain the email +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + If a redirection is performed after sending the email (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 in From a21b1602e421cd147ef081f81b68431e9b5bffa8 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 23 Nov 2016 08:44:44 +0100 Subject: [PATCH 5/6] Reworded a subtitle --- email/testing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/email/testing.rst b/email/testing.rst index d754f692c8b..2b0c4b85dca 100644 --- a/email/testing.rst +++ b/email/testing.rst @@ -66,8 +66,8 @@ to get information about the messages sent on the previous request:: Troubleshooting --------------- -Problem: The mail collector returns `null` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Problem: The collector object is `null` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The email collector is only available when the profiler is enabled and collects information, as explained in :doc:`/testing/profiling`. From adb903fae520d69ee2b7f975e7ea61ec1efb8e52 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 23 Nov 2016 08:45:27 +0100 Subject: [PATCH 6/6] Fixed a syntax error --- email/testing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/email/testing.rst b/email/testing.rst index 2b0c4b85dca..66df5f33f8b 100644 --- a/email/testing.rst +++ b/email/testing.rst @@ -66,8 +66,8 @@ to get information about the messages sent on the previous request:: Troubleshooting --------------- -Problem: The collector object is `null` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Problem: The collector object is ``null`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The email collector is only available when the profiler is enabled and collects information, as explained in :doc:`/testing/profiling`.