@@ -206,6 +206,37 @@ public function testReleaseTransitionsEveryEnvelopeSibling()
206206 $ this ->assertStringStartsNotWith ('sandboxed- ' , (string ) $ fresh ->first ()->provider_message_id );
207207 }
208208
209+ /**
210+ * Release flips every sibling row to sent, so the send must reach the
211+ * whole original envelope, whichever row the operator released from.
212+ */
213+ public function testReleaseFromAnyRowSendsTheOriginalEnvelope ()
214+ {
215+ Mail::html ('<p>Hello all</p> ' , function ($ m ) {
216+ $ m ->to (['to@example.com ' , 'to2@example.com ' ])->cc ('cc@example.com ' )->bcc ('bcc@example.com ' )->subject ('Team update ' );
217+ });
218+
219+ Postmaster::release (EmailMessage::where ('recipient_role ' , 'bcc ' )->firstOrFail ());
220+
221+ $ sent = Mail::mailer ('array ' )->getSymfonyTransport ()->messages ()->last ()->getOriginalMessage ();
222+ $ addresses = fn (array $ list ) => array_map (fn ($ a ) => $ a ->getAddress (), $ list );
223+ $ this ->assertSame (['to@example.com ' , 'to2@example.com ' ], $ addresses ($ sent ->getTo ()));
224+ $ this ->assertSame (['cc@example.com ' ], $ addresses ($ sent ->getCc ()));
225+ $ this ->assertSame (['bcc@example.com ' ], $ addresses ($ sent ->getBcc ()));
226+ }
227+
228+ public function testDashboardReleaseConfirmationNamesEveryRecipient ()
229+ {
230+ Postmaster::auth (fn () => true );
231+ Mail::html ('<p>Hello all</p> ' , function ($ m ) {
232+ $ m ->to ('to@example.com ' )->cc ('cc@example.com ' )->subject ('Team update ' );
233+ });
234+
235+ $ this ->get ('/postmaster/messages/ ' .EmailMessage::where ('recipient_role ' , 'cc ' )->firstOrFail ()->getKey ())
236+ ->assertOk ()
237+ ->assertSee ('send it for real to to@example.com, cc@example.com? ' );
238+ }
239+
209240 public function testDashboardShowsReleaseOnASandboxedMessage ()
210241 {
211242 Postmaster::auth (fn () => true );
0 commit comments