chore: send email and recive
This commit is contained in:
@@ -32,8 +32,8 @@ export class User extends BaseEntity {
|
||||
emailQuotaUsed?: number; // Email quota used in bytes
|
||||
|
||||
// Email account integration fields
|
||||
@Property({ type: "varchar", length: 255, nullable: true })
|
||||
wildduckUserId?: string; // WildDuck user ID
|
||||
@Property({ type: "varchar", length: 255, nullable: false })
|
||||
wildduckUserId: string; // WildDuck user ID
|
||||
|
||||
@Property({ type: "varchar", length: 255, nullable: true })
|
||||
displayName?: string; // Display name for email
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user