fixing notification provider

This commit is contained in:
weakmap@gmail.com
2023-09-27 17:45:38 +02:00
parent fbad4456d7
commit 17b4bad2e4
8 changed files with 222 additions and 135 deletions

View File

@@ -1,7 +1,7 @@
import sgMail from '@sendgrid/mail';
import { markdown2Html } from '../../services/markdown.js';
export const send = ({ serviceName, newListings, notificationConfig, jobKey }) => {
const { apiKey, receiver, from, templateId } = notificationConfig.find((adapter) => adapter.id === 'sendGrid').fields;
const { apiKey, receiver, from, templateId } = notificationConfig.find((adapter) => adapter.id === config.id).fields;
sgMail.setApiKey(apiKey);
const msg = {
templateId,