feat: add docker commands to start sending emails

This commit is contained in:
Karol Sójko 2022-06-27 11:56:42 +02:00
parent 46cba52bcb
commit 210a314c81
No known key found for this signature in database
GPG key ID: 78C42DF8267BAF26
3 changed files with 13 additions and 0 deletions

View file

@ -107,6 +107,12 @@ void container.load().then((container) => {
logger.info(`Starting email campaign for email ${emailMessageIdentifier} ...`)
if (!emailMessageIdentifier) {
logger.error('No email message identifier passed as argument. Skipped sending.')
process.exit(1)
}
const userRepository: UserRepositoryInterface = container.get(TYPES.UserRepository)
const settingService: SettingServiceInterface = container.get(TYPES.SettingService)
const userSubscriptionRepository: UserSubscriptionRepositoryInterface = container.get(

View file

@ -44,6 +44,12 @@ case "$COMMAND" in
yarn workspace @standardnotes/auth-server daily-backup:one_drive
;;
'email-campaign' )
echo "Starting Email Campaign Sending..."
MESSAGE_IDENTIFIER=$1 && shift 1
yarn workspace @standardnotes/auth-server email-campaign $MESSAGE_IDENTIFIER
;;
* )
echo "Unknown command"
;;

View file

@ -25,6 +25,7 @@
"daily-backup:google_drive": "yarn node dist/bin/backup.js google_drive daily",
"daily-backup:one_drive": "yarn node dist/bin/backup.js one_drive daily",
"weekly-backup:email": "yarn node dist/bin/backup.js email weekly",
"email-campaign": "yarn node dist/bin/email.js",
"typeorm": "typeorm-ts-node-commonjs"
},
"dependencies": {