import fetch from 'node-fetch'; import envConfig from '../env/env-config'; import { getNodeProfile } from '../env/nodeProfile'; import { HTTP_METHOD } from './httpMethod'; export async function doMailHogSearch(searchCriteria: string): Promise { const defaultPartyCompany = envConfig.defaultParty.applicant; const mailServerUrl = getNodeProfile(defaultPartyCompany).mailServerUrl; const mailHogSearch = mailServerUrl + envConfig.pages.mailhogSearch + searchCriteria; const response = await fetch(mailHogSearch, { method: HTTP_METHOD.GET, headers: { 'Content-Type': 'application/json' } }); return response.text(); }