chore: rename resend package (#6168)

This commit is contained in:
Elliot DeNolf
2024-05-01 12:02:40 -04:00
committed by GitHub
parent d8f91cc94c
commit c6132df866
21 changed files with 14 additions and 11 deletions

View File

@@ -0,0 +1,8 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
ignorePatterns: ['payload-types.ts'],
parserOptions: {
project: ['./tsconfig.eslint.json'],
tsconfigRootDir: __dirname,
},
}

2
test/email-resend/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/media
/media-gif

View File

@@ -0,0 +1,34 @@
import { resendAdapter } from '@payloadcms/email-resend'
import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
import { devUser } from '../credentials.js'
export default buildConfigWithDefaults({
// ...extend config here
collections: [],
// NOTE: The from address and api key should be properly set
// See email-resend README for more information
email: resendAdapter({
defaultFromAddress: 'dev@payloadcms.com',
defaultFromName: 'Payload CMS',
apiKey: process.env.RESEND_API_KEY || '',
}),
onInit: async (payload) => {
await payload.create({
collection: 'users',
data: {
email: devUser.email,
password: devUser.password,
},
})
const email = await payload.sendEmail({
to: 'dev@payloadcms.com',
subject: 'This was sent on init',
text: 'This is my message body',
})
payload.logger.info({ msg: 'Email sent', email })
},
})

View File

@@ -0,0 +1,50 @@
/* tslint:disable */
/**
* This file was automatically generated by Payload.
* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,
* and re-run `payload generate:types` to regenerate this file.
*/
export interface Config {
collections: {
posts: Post
media: Media
users: User
}
globals: {
menu: Menu
}
}
export interface Post {
id: string
text?: string
associatedMedia?: string | Media
updatedAt: string
createdAt: string
}
export interface Media {
id: string
updatedAt: string
createdAt: string
url?: string
filename?: string
mimeType?: string
filesize?: number
width?: number
height?: number
}
export interface User {
id: string
updatedAt: string
createdAt: string
email?: string
resetPasswordToken?: string
resetPasswordExpiration?: string
loginAttempts?: number
lockUntil?: string
password?: string
}
export interface Menu {
id: string
globalText?: string
}

View File

@@ -0,0 +1,13 @@
{
// extend your base config to share compilerOptions, etc
//"extends": "./tsconfig.json",
"compilerOptions": {
// ensure that nobody can accidentally use this config for a build
"noEmit": true
},
"include": [
// whatever paths you intend to lint
"./**/*.ts",
"./**/*.tsx"
]
}