File tree Expand file tree Collapse file tree 5 files changed +20
-7
lines changed
lib/internal/Magento/Framework/Mail Expand file tree Collapse file tree 5 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -89,10 +89,23 @@ public function getBody()
89
89
90
90
/**
91
91
* {@inheritdoc}
92
+ *
93
+ * @deprecated This function is missing the from name. The
94
+ * setFromAddress() function sets both from address and from name.
95
+ * @see setFromAddress()
92
96
*/
93
97
public function setFrom ($ fromAddress )
94
98
{
95
- $ this ->zendMessage ->setFrom ($ fromAddress );
99
+ $ this ->setFromAddress ($ fromAddress , null );
100
+ return $ this ;
101
+ }
102
+
103
+ /**
104
+ * {@inheritdoc}
105
+ */
106
+ public function setFromAddress ($ fromAddress , $ fromName = null )
107
+ {
108
+ $ this ->zendMessage ->setFrom ($ fromAddress , $ fromName );
96
109
return $ this ;
97
110
}
98
111
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ public function setFrom($from)
200
200
public function setFromByStore ($ from , $ store = null )
201
201
{
202
202
$ result = $ this ->_senderResolver ->resolve ($ from , $ store );
203
- $ this ->message ->setFrom ($ result ['email ' ], $ result ['name ' ]);
203
+ $ this ->message ->setFromAddress ($ result ['email ' ], $ result ['name ' ]);
204
204
return $ this ;
205
205
}
206
206
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ public function __construct(
54
54
public function setFromByStore ($ from , $ store )
55
55
{
56
56
$ result = $ this ->senderResolver ->resolve ($ from , $ store );
57
- $ this ->message ->setFrom ($ result ['email ' ], $ result ['name ' ]);
57
+ $ this ->message ->setFromAddress ($ result ['email ' ], $ result ['name ' ]);
58
58
59
59
return $ this ;
60
60
}
Original file line number Diff line number Diff line change @@ -55,8 +55,8 @@ public function testSetFromByStore()
55
55
->with ($ sender , $ store )
56
56
->willReturn ($ sender );
57
57
$ this ->messageMock ->expects ($ this ->once ())
58
- ->method ('setFrom ' )
59
- ->with (' from@example.com ' , 'name ' )
58
+ ->method ('setFromAddress ' )
59
+ ->with ($ sender [ ' email ' ], $ sender [ 'name ' ] )
60
60
->willReturnSelf ();
61
61
62
62
$ this ->model ->setFromByStore ($ sender , $ store );
Original file line number Diff line number Diff line change @@ -176,8 +176,8 @@ public function testSetFromByStore()
176
176
->with ($ sender , $ store )
177
177
->willReturn ($ sender );
178
178
$ this ->messageMock ->expects ($ this ->once ())
179
- ->method ('setFrom ' )
180
- ->with (' from@example.com ' , 'name ' )
179
+ ->method ('setFromAddress ' )
180
+ ->with ($ sender [ ' email ' ], $ sender [ 'name ' ] )
181
181
->willReturnSelf ();
182
182
183
183
$ this ->builder ->setFromByStore ($ sender , $ store );
You can’t perform that action at this time.
0 commit comments