File tree 1 file changed +17
-3
lines changed
1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 25
25
* @license http://github.com/sourcerer-mike/mage_devMode/blob/master/License.md BSD 3-Clause ("BSD New")
26
26
* @link http://github.com/sourcerer-mike/mage_devMode
27
27
* @since $VERSION$
28
+ *
29
+ * @method string getToMail()
30
+ * @method $this setToMail(string $mail)
28
31
*/
29
32
class LeMike_DevMode_Model_Core_Email extends Mage_Core_Model_Email
30
33
{
34
+ /**
35
+ * Transfer mails in different ways.
36
+ *
37
+ * Mails will be:
38
+ * - if lemike_devmode_core/email/recipient is empty the mail will be shown
39
+ * otherwise send to lemike_devmode_core/email/recipient
40
+ *
41
+ * @return $this
42
+ */
31
43
public function send ()
32
44
{
33
45
$ recipient = Mage::getStoreConfig ('lemike_devmode_core/email/recipient ' );
34
46
35
47
if ($ recipient )
36
- {
48
+ { // recipient is set: send mail to him
37
49
LeMike_DevMode_Model_Log::info (
38
50
'Reroute mail from " ' . $ this ->getToMail () . '" to " ' . $ recipient . '". '
39
51
);
40
52
$ this ->setToEmail ($ recipient );
53
+
54
+ return parent ::send ();
41
55
}
42
56
else
43
- {
57
+ { // no receipient set: show content
44
58
var_dump ($ this ->getBody ());
45
59
}
46
60
47
- return parent :: send () ;
61
+ return $ this ;
48
62
}
49
63
}
You can’t perform that action at this time.
0 commit comments