Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add a fluent interface #2

Open
jayanratna opened this issue Feb 2, 2023 · 0 comments
Open

feat: Add a fluent interface #2

jayanratna opened this issue Feb 2, 2023 · 0 comments

Comments

@jayanratna
Copy link
Collaborator

To improve the development experience it might be handy to create a fluent interface to easily send emails:

use Resend\Email;

$resend = Resend::client('re_123456789');

$email = (new Email())
    ->to('...')
    ->from('...')
    ->subject('...')
    ->text('...');

if ($user->is_premium) {
    $email->html('...');
}

$resend->sendEmail($email);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant