mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-15 09:11:57 +10:00
fix(server): ⚡ don't initialize sendgrid if the apikey is empty
This commit is contained in:
@ -7,7 +7,11 @@ import { User } from '@/users/entities/user.entity';
|
||||
@Injectable()
|
||||
export class MailService {
|
||||
constructor(private configService: ConfigService) {
|
||||
SendGrid.setApiKey(this.configService.get<string>('sendgrid.apiKey'));
|
||||
const sendGridApiKey = this.configService.get<string>('sendgrid.apiKey');
|
||||
|
||||
if (sendGridApiKey) {
|
||||
SendGrid.setApiKey(this.configService.get<string>('sendgrid.apiKey'));
|
||||
}
|
||||
}
|
||||
|
||||
async sendEmail(mail: SendGrid.MailDataRequired) {
|
||||
|
||||
Reference in New Issue
Block a user