Move email templates in assets directory

This commit is contained in:
Chocobozzz 2024-03-20 09:15:07 +01:00
parent b4169fe0a4
commit be19d9be34
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
31 changed files with 2 additions and 4 deletions

View File

@ -8,5 +8,4 @@ npm run tsc -- -b --verbose server/tsconfig.json
npm run resolve-tspaths:server
cp -r "./server/core/static" "./server/core/assets" ./dist/core
cp -r "./server/core/lib/emails" "./dist/core/lib"
cp "./server/scripts/upgrade.sh" "./dist/scripts"

View File

@ -20,6 +20,5 @@ npm run tsc -- -b -v --incremental server/tsconfig.json
npm run resolve-tspaths:server
cp -r ./server/core/static ./server/core/assets ./dist/core
cp -r "./server/core/lib/emails" "./dist/core/lib"
./node_modules/.bin/tsc-watch --build --preserveWatchOutput --verbose --onSuccess 'sh -c "npm run resolve-tspaths:server && NODE_ENV=dev node dist/server"' server/tsconfig.json

View File

@ -264,7 +264,7 @@ class Emailer {
},
transport: this.transporter,
views: {
root: join(root(), 'dist', 'core', 'lib', 'emails')
root: join(root(), 'dist', 'core', 'assets', 'email-templates')
},
subjectPrefix: CONFIG.EMAIL.SUBJECT.PREFIX
})

View File

@ -61,7 +61,7 @@ Some of these may be optional (for example your new endpoint may not need to sen
- Create the notification logic in `server/core/lib/notifier/shared`:
+ Email subject has a common prefix (defined by the admin in PeerTube configuration)
- Add your notification to `server/core/lib/notifier/notifier.ts`
- Create the email template in `server/core/lib/emails`:
- Create the email template in `server/core/assets/email-templates`:
+ A text version is automatically generated from the HTML
+ The template usually extends `../common/grettings` that already says "Hi" and "Cheers". You just have to write the title and the content blocks that will be inserted in the appropriate places in the HTML template
- If you need to associate a new table with `userNotification`: