24 lines
770 B
TypeScript
24 lines
770 B
TypeScript
import { Injectable } from '@nestjs/common';
|
|
import { Activity, ActivityMethod } from 'nestjs-temporal-core';
|
|
import { EmailService } from '@gitroom/nestjs-libraries/services/email.service';
|
|
import { OrganizationService } from '@gitroom/nestjs-libraries/database/prisma/organizations/organization.service';
|
|
|
|
@Injectable()
|
|
@Activity()
|
|
export class EmailActivity {
|
|
constructor(
|
|
private _emailService: EmailService,
|
|
private _organizationService: OrganizationService
|
|
) {}
|
|
|
|
@ActivityMethod()
|
|
async sendEmail(to: string, subject: string, html: string, replyTo?: string) {
|
|
return this._emailService.sendEmailSync(to, subject, html, replyTo);
|
|
}
|
|
|
|
@ActivityMethod()
|
|
async getUserOrgs(id: string) {
|
|
return this._organizationService.getTeam(id);
|
|
}
|
|
}
|