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

question about environments #71

Closed
colinricardo opened this issue Mar 28, 2023 · 3 comments
Closed

question about environments #71

colinricardo opened this issue Mar 28, 2023 · 3 comments

Comments

@colinricardo
Copy link

what is the best way to avoid sending emails in non-production environments?

is it to add a MockResend class or is there a param I can pass to the constructor?

@bukinoshita
Copy link
Member

Do you want to send actual emails to inbox or just sending to for example success@resend.dev and returning a success event would work?

@colinricardo
Copy link
Author

just a fake success response, something like this:

class MockResend extends Resend {
  sendEmail = async (data: SendEmailData): Promise<SendEmailResponse> => {
    const { react, ...rest } = data;
    const { props } = react;
    log("Would have sent email in production", { ...rest, props });
    return {
      id: "xxx",
      created_at: "xxx",
    } as SendEmailResponse;
  };
}

@bukinoshita
Copy link
Member

It's not yet documented, but we worked on sending emails with our testing emails. So try sending an email to and let me know

  • success@resend.dev
  • bounces@resend.dev

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

2 participants