mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
fix: issue in mail sender.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Container, Inject } from 'typedi';
|
||||
import { Container } from 'typedi';
|
||||
import AuthenticationService from 'services/Authentication';
|
||||
|
||||
export default class WelcomeEmailJob {
|
||||
@@ -21,18 +21,18 @@ export default class WelcomeEmailJob {
|
||||
* @param {Function} done
|
||||
*/
|
||||
public async handler(job, done: Function): Promise<void> {
|
||||
const { organizationName, user } = job.attrs.data;
|
||||
const { organizationId, user } = job.attrs.data;
|
||||
const Logger: any = Container.get('logger');
|
||||
const authService = Container.get(AuthenticationService);
|
||||
|
||||
Logger.info(`[welcome_mail] send welcome mail message - started: ${job.attrs.data}`);
|
||||
Logger.info(`[welcome_mail] started: ${job.attrs.data}`);
|
||||
|
||||
try {
|
||||
await authService.mailMessages.sendWelcomeMessage(user, organizationName);
|
||||
Logger.info(`[welcome_mail] send welcome mail message - finished: ${job.attrs.data}`);
|
||||
await authService.mailMessages.sendWelcomeMessage(user, organizationId);
|
||||
Logger.info(`[welcome_mail] finished: ${job.attrs.data}`);
|
||||
done();
|
||||
} catch (error) {
|
||||
Logger.info(`[welcome_mail] send welcome mail message - error: ${job.attrs.data}, error: ${error}`);
|
||||
Logger.error(`[welcome_mail] error: ${job.attrs.data}, error: ${error}`);
|
||||
done(error);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user