test: clean up email-nodemailer config
This commit is contained in:
@@ -1,14 +1,8 @@
|
|||||||
import { createNodemailerAdapter } from '@payloadcms/email-nodemailer'
|
import { createNodemailerAdapter } from '@payloadcms/email-nodemailer'
|
||||||
import path from 'path'
|
|
||||||
import { getFileByPath } from 'payload/uploads'
|
|
||||||
import { fileURLToPath } from 'url'
|
|
||||||
|
|
||||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
|
import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
|
||||||
import { devUser } from '../credentials.js'
|
import { devUser } from '../credentials.js'
|
||||||
|
|
||||||
const filename = fileURLToPath(import.meta.url)
|
|
||||||
const dirname = path.dirname(filename)
|
|
||||||
|
|
||||||
export default buildConfigWithDefaults({
|
export default buildConfigWithDefaults({
|
||||||
// ...extend config here
|
// ...extend config here
|
||||||
collections: [],
|
collections: [],
|
||||||
@@ -27,14 +21,6 @@ export default buildConfigWithDefaults({
|
|||||||
subject: 'This was sent on init',
|
subject: 'This was sent on init',
|
||||||
})
|
})
|
||||||
|
|
||||||
// Create image
|
payload.logger.info({ msg: 'Email sent', email })
|
||||||
const imageFilePath = path.resolve(dirname, '../uploads/image.png')
|
|
||||||
const imageFile = await getFileByPath(imageFilePath)
|
|
||||||
|
|
||||||
await payload.create({
|
|
||||||
collection: 'media',
|
|
||||||
data: {},
|
|
||||||
file: imageFile,
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user