Skip to content

Commit

Permalink
fix(vbd): emailListProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhooks committed Jun 17, 2024
1 parent cd55890 commit 8fdad81
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { emailListProvider } from '@/coursebuilder/email-list-provider'
import { emailProvider } from '@/coursebuilder/email-provider'
import { openaiProvider } from '@/coursebuilder/openai-provider'
import { stripeProvider } from '@/coursebuilder/stripe-provider'
Expand All @@ -21,6 +22,7 @@ export const courseBuilderConfig: NextCourseBuilderConfig = {
openaiProvider,
stripeProvider,
emailProvider,
emailListProvider,
],
basePath: '/api/coursebuilder',
callbacks: {
Expand Down
10 changes: 10 additions & 0 deletions apps/value-based-design/src/coursebuilder/email-list-provider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { env } from '@/env.mjs'

import ConvertkitProvider from '@coursebuilder/core/providers/convertkit'

export const emailListProvider = ConvertkitProvider({
apiKey: env.CONVERTKIT_API_KEY,
apiSecret: env.CONVERTKIT_API_SECRET,
defaultListType: 'form',
defaultListId: env.CONVERTKIT_SIGNUP_FORM,
})
6 changes: 6 additions & 0 deletions apps/value-based-design/src/env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export const env = createEnv({
EMAIL_SERVER_HOST: z.string().optional(),
EMAIL_SERVER_PORT: z.string().optional(),
POSTMARK_KEY: z.string().optional(),
CONVERTKIT_API_SECRET: z.string(),
CONVERTKIT_API_KEY: z.string(),
CONVERTKIT_SIGNUP_FORM: z.union([z.string(), z.number()]),
},

/**
Expand Down Expand Up @@ -135,6 +138,9 @@ export const env = createEnv({
EMAIL_SERVER_PORT: process.env.EMAIL_SERVER_PORT,
POSTMARK_KEY: process.env.POSTMARK_KEY,
NEXT_PUBLIC_SITE_TITLE: process.env.NEXT_PUBLIC_SITE_TITLE,
CONVERTKIT_API_SECRET: process.env.CONVERTKIT_API_SECRET,
CONVERTKIT_API_KEY: process.env.CONVERTKIT_API_KEY,
CONVERTKIT_SIGNUP_FORM: process.env.CONVERTKIT_SIGNUP_FORM,
},
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
Expand Down

0 comments on commit 8fdad81

Please sign in to comment.