chore: send email and recive

This commit is contained in:
mahyargdz
2025-07-09 16:18:54 +03:30
parent b3ab6c8a10
commit 092abd2895
13 changed files with 212 additions and 98 deletions
@@ -35,6 +35,12 @@ export class UsersService {
private readonly domainsService: DomainsService,
) {}
async getUserEmailIdFromId(userId: string) {
const user = await this.userRepository.findOne({ id: userId }, { populate: ["role"] });
if (!user) throw new BadRequestException(UserMessage.USER_NOT_FOUND);
return user.wildduckUserId;
}
async findOneWithEmail(email: string, businessId: string) {
const user = await this.userRepository.findOne({ emailAddress: email, business: { id: businessId } }, { populate: ["role"] });
return user;