Send Events mail from platform SMTP like Invoice, not owner Bird domain.
Deploy Ladill Events / deploy (push) Successful in 31s
Deploy Ladill Events / deploy (push) Successful in 31s
Use EventMailer with MAIL_FROM and organiser Reply-To instead of the Bird API, which rewrote the From address onto the account's verified domain (e.g. climp.me). Redesign the speaker invitation to use the shared Events email layout. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Models\User;
|
||||
use App\Services\Events\EventSpeakerInviteService;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Tests\TestCase;
|
||||
|
||||
class EventSpeakerInviteTest extends TestCase
|
||||
@@ -19,14 +20,17 @@ class EventSpeakerInviteTest extends TestCase
|
||||
$this->withoutMiddleware(\App\Http\Middleware\EnsurePlatformSession::class);
|
||||
|
||||
config([
|
||||
'smtp.platform_api_key' => 'test-smtp-key',
|
||||
'smtp.platform_api_url' => 'https://ladill.test/api/smtp',
|
||||
'mail.from.address' => 'events@ladill.com',
|
||||
'mail.from.name' => 'Ladill Events',
|
||||
'events.service_api_keys.meet' => 'test-meet-key',
|
||||
]);
|
||||
|
||||
Mail::fake();
|
||||
|
||||
Http::fake([
|
||||
config('billing.api_url').'/balance*' => Http::response(['balance_minor' => 50000]),
|
||||
'https://ladill.test/api/smtp/messages/send' => Http::response(['success' => true]),
|
||||
config('billing.api_url').'/can-afford*' => Http::response(['affordable' => true]),
|
||||
config('billing.api_url').'/debit' => Http::response(['success' => true]),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -99,8 +103,7 @@ class EventSpeakerInviteTest extends TestCase
|
||||
->assertRedirect(route('speakers.show', $event))
|
||||
->assertSessionHas('success');
|
||||
|
||||
Http::assertSent(fn ($request) => str_contains($request->url(), '/messages/send')
|
||||
&& $request['to'] === 'alex@example.com');
|
||||
Http::assertSent(fn ($request) => str_contains($request->url(), '/debit'));
|
||||
|
||||
$event->refresh();
|
||||
$speaker = $event->content()['speakers'][0];
|
||||
@@ -163,7 +166,7 @@ class EventSpeakerInviteTest extends TestCase
|
||||
|
||||
app(EventSpeakerInviteService::class)->inviteProgrammeHosts($programme, $owner);
|
||||
|
||||
Http::assertSent(fn ($request) => $request['to'] === 'pat@example.com');
|
||||
Http::assertSent(fn ($request) => str_contains($request->url(), '/debit'));
|
||||
|
||||
$event->refresh();
|
||||
$speaker = $event->content()['speakers'][0];
|
||||
@@ -229,7 +232,7 @@ class EventSpeakerInviteTest extends TestCase
|
||||
|
||||
public function test_manual_speaker_invite_reports_when_email_not_configured(): void
|
||||
{
|
||||
config(['smtp.platform_api_key' => '']);
|
||||
config(['mail.from.address' => '']);
|
||||
|
||||
$owner = User::factory()->create(['public_id' => 'usr_sp_no_smtp']);
|
||||
|
||||
@@ -293,6 +296,6 @@ class EventSpeakerInviteTest extends TestCase
|
||||
->assertRedirect(route('speakers.show', $event))
|
||||
->assertSessionHas('success');
|
||||
|
||||
Http::assertSent(fn ($request) => $request['to'] === 'pat@example.com');
|
||||
Http::assertSent(fn ($request) => str_contains($request->url(), '/debit'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user