// ── Welcome email on registration ───────────────────────────── // Template: /storage/email-templates/welcome.html // Uses {{name}}, {{app_name}}, {{app_url}} placeholders Mailer::send($provider, $user['email'], 'welcome', [ 'name' => $user['name'], 'app_name' => APP_NAME, 'app_url' => APP_URL, ]); // ── Password reset link ─────────────────────────────────────── // Template: /storage/email-templates/password-reset.html // Uses {{name}}, {{link}} Mailer::send($provider, $user['email'], 'password-reset', [ 'name' => $user['name'], 'link' => APP_URL . '/reset-password?token=' . $token, ]); // ── Order confirmation ──────────────────────────────────────── // Template: /storage/email-templates/order-confirm.html Mailer::send($provider, $user['email'], 'order-confirm', [ 'name' => $user['name'], 'order_id' => $order->id, 'total' => Region::money($order->total, $user['country_code']), 'created_at' => AppDateTime::forRegion($order->created_at, $user['country_code']), 'support' => SUPPORT_EMAIL, ]); // ── Custom subject override ─────────────────────────────────── Mailer::send( $provider, $user['email'], 'invoice', ['name' => $user['name'], 'order_id' => $order->id], 'Your invoice #' . $order->id . ' from ' . APP_NAME ); // ── Blast to multiple users ─────────────────────────────────── $emails = array_column($activeUsers, 'email'); Mailer::sendBulk($emails, 'promo-launch', [ 'app_name' => APP_NAME, 'promo' => '20% off all orders this weekend', ]); // ── What an email template looks like ──────────────────────── // /storage/email-templates/order-confirm.html // //

Hi {{name}},

//

Your order #{{order_id}} has been confirmed.

//

Total: {{total}}

//

Placed: {{created_at}}

//

Questions? {{support}}