What you get
- OAuth connection to your Laravel Cloud organization.
- Resource you can reuse across environments.
- A sending key for each environment, injected as environment variables.
- Billing that stays on your Resend plan.
Prerequisites
- A Laravel Cloud organization with an environment.
- A Resend account with a verified domain.
Connect your Resend account
Connect from the organization settings, or the first time you attach email to an environment. Either path sends you to Resend to approve access. Prefer a video walkthrough?1
Open the canvas
Open the environment canvas and choose the Email resource.
2
Approve full access
On the Resend consent screen, pick the team Laravel Cloud should use and choose Full access. Laravel Cloud returns you to the same environment and imports the sending domains already on that team.
Full access lets Laravel Cloud import your existing domains and set up the
webhooks it needs. Sending access can only send email, so Laravel Cloud
can’t finish setup with that permission.
3
Connect a domain and create a key
Select a verified domain or create a new one. Click Continue.Enter the sender address and sender name, then choose a sending key.
- Create a new key creates a full access key used by this environment.
- Reuse existing key shares a key already used by another environment in the organization.
4
Redeploy your application
For changes to take effect, redeploy your application.
Injected environment variables
MAIL_FROM_ADDRESS and MAIL_FROM_NAME use the sender you entered. Laravel Cloud encrypts RESEND_API_KEY and masks it, the same way it handles a database password.
A custom environment variable with the same name takes priority over an injected one. Define the custom variable, then deploy. See Laravel Cloud’s environment variables documentation for how overrides work.
To send from your own machine, copy these variables into your local .env. Laravel Cloud injects them into the hosted environment.
Send from your application
Laravel
Laravel ships with a Resend mail transport. The transport needs Resend’s PHP SDK. If the package is missing, Laravel Cloud prompts you to add it to the project’s dependencies:resend/resend-laravel for the Laravel SDK, or send over SMTP.
Other frameworks
Laravel Cloud injectsRESEND_API_KEY for every runtime. Read the key from the environment and pass it to the API or an SDK.
Queued mail can fail as a failed job. Laravel
Nightwatch traces those jobs and alerts you
when they start failing.
Attach Resend with the API
Attach Resend to an environment with a bearer token from the Laravel Cloud UI.from_address and from_name are required. Set key_strategy to create for a new key, or reuse and pass reuse_key_id to share a key another environment already uses. key_name is optional.
- List sending domains for the organization.
- List reusable sending keys that other environments can share.
- Update the sender with
from_addressandfrom_name. - Detach Resend. This deletes the environment’s sending key unless another environment shares it.
Next steps
- Send your first email with Laravel.
- Add and verify a domain.
- Design messages with Templates.
- Follow up with an Automation.