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

Add Sandbox Mode onto SendGridMessage #3

Merged
merged 7 commits into from
Aug 12, 2022
Merged

Conversation

zbrody
Copy link
Contributor

@zbrody zbrody commented Aug 12, 2022

This package served our needs perfectly but I noticed while using the package in my project, we were struggling to enable sandbox mode to ensure emails are not sent to the recipients.

This PR exposes a new 'enableSandboxMode' function on the SendGridMessage class.

We think this could be a nice feature to include in the package as I think other developers can make use of it by chaining on a new function within the SendGridMessage which allows the user to have sandbox enabled.

The default behaviour of the package remains unchanged and the tests have been updated

public function toSendGrid($notifiable): SendGridMessage
{
    return (new SendGridMessage(config('services.sendgrid.templates.default')))
        ->enableSandboxMode(config('services.sendgrid.sandbox_enabled'))
        ->payload([
            ...
        ]);
}

@aozisik aozisik changed the base branch from master to dev August 12, 2022 13:43
@aozisik
Copy link
Contributor

aozisik commented Aug 12, 2022

Thank you very much for your contribution @zbrody! I'll revise a few things and make a new release soon.

@aozisik aozisik merged commit defecfa into swiftmade:dev Aug 12, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants