Skip to content

Commit

Permalink
Fix disable custom send in development (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
4leite authored Jun 14, 2024
1 parent d89bb71 commit ecdcc22
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/shiny-llamas-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-oberon-app": patch
---

Fix default disable custom plugins in development
2 changes: 2 additions & 0 deletions packages/create-oberon-app/plugins/send/custom.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "server-cli-only"

import {
USE_DEVELOPMENT_SEND_PLUGIN,
notImplemented,
type OberonPlugin,
type OberonSendAdapter,
Expand All @@ -11,6 +12,7 @@ const SEND_SECRET = process.env.SEND_SECRET

export const plugin: OberonPlugin = () => ({
name: "Custom Send Plugin",
disabled: USE_DEVELOPMENT_SEND_PLUGIN,
adapter: {
sendVerificationRequest: async ({
email,
Expand Down
7 changes: 6 additions & 1 deletion packages/create-oberon-app/plugins/send/resend.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import "server-cli-only"

import { Resend } from "resend"
import type { OberonPlugin, OberonSendAdapter } from "@oberoncms/core"
import {
USE_DEVELOPMENT_SEND_PLUGIN,
type OberonPlugin,
type OberonSendAdapter,
} from "@oberoncms/core"

const EMAIL_FROM = process.env.EMAIL_FROM
const RESEND_SECRET = process.env.RESEND_SECRET || process.env.SEND_SECRET

export const plugin: OberonPlugin = () => ({
name: "Resend",
disabled: USE_DEVELOPMENT_SEND_PLUGIN,
adapter: {
sendVerificationRequest: async ({
email,
Expand Down
7 changes: 6 additions & 1 deletion packages/create-oberon-app/plugins/send/sendgrid.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import "server-cli-only"

import sgMail from "@sendgrid/mail"
import type { OberonPlugin, OberonSendAdapter } from "@oberoncms/core"
import {
USE_DEVELOPMENT_SEND_PLUGIN,
type OberonPlugin,
type OberonSendAdapter,
} from "@oberoncms/core"

const EMAIL_FROM = process.env.EMAIL_FROM
const SENDGRID_API_KEY = process.env.SENDGRID_API_KEY || process.env.SEND_SECRET

export const plugin: OberonPlugin = () => ({
name: "Sendgrid",
disabled: USE_DEVELOPMENT_SEND_PLUGIN,
adapter: {
sendVerificationRequest: async ({
email,
Expand Down

0 comments on commit ecdcc22

Please sign in to comment.