Ensure that if no env is provided it uses the old email settings

This commit is contained in:
Thomas Rogers 2024-11-02 20:05:00 +01:00
parent 34e039e4e7
commit 8b845b5433

View file

@ -113,7 +113,9 @@ const createRandomEmailAddress = (userName: string, length: number): string => {
when rand is sdfsdf-: jacksonh-sdfsdf-e@inbox.omnivore.app
when rand is abcdef: jacksonh-abcdefe@inbox.omnivore.app
*/
return `${userName}-${nanoid(length)}e@${env.email.domain}`
return `${userName}-${nanoid(length)}e@${
env.email.domain || `@${inbox}.omnivore.app`
}`
}
export const findNewsletterEmailById = async (