@@ -5,7 +5,6 @@ import { sortBy } from 'lodash'
55
66import appConfig from '@/config/app'
77import HttpError from '@/errors/http'
8- import { getLdFlagValue } from '@/helpers/launch-darkly'
98
109import {
1110 PostmanEmailDataOut ,
@@ -80,24 +79,14 @@ export async function sendTransactionalEmails(
8079 errorStatus ?: PostmanEmailSendStatus
8180 error ?: HttpError
8281} > {
83- const shouldUseNewCredentials = await getLdFlagValue < boolean > (
84- 'new_postman_credentials' ,
85- '[email protected] ' , // mock email 86- false ,
87- )
88-
8982 const promises = recipients . map ( async ( recipientEmail ) => {
9083 const requestData = new FormData ( )
9184 requestData . append ( 'subject' , email . subject )
9285 requestData . append ( 'body' , email . body )
9386 requestData . append ( 'recipient' , recipientEmail )
9487 requestData . append (
9588 'from' ,
96- `${ email . senderName } <${
97- shouldUseNewCredentials
98- ? appConfig . postman . fromAddress
99- : appConfig . postman . oldFromAddress
100- } >`,
89+ `${ email . senderName } <${ appConfig . postman . fromAddress } >` ,
10190 )
10291 requestData . append ( 'disable_tracking' , 'true' )
10392 if ( email . ccList ?. length > 0 ) {
@@ -123,11 +112,7 @@ export async function sendTransactionalEmails(
123112 {
124113 headers : {
125114 ...requestData . getHeaders ( ) ,
126- Authorization : `Bearer ${
127- shouldUseNewCredentials
128- ? appConfig . postman . apiKey
129- : appConfig . postman . oldApiKey
130- } `,
115+ Authorization : `Bearer ${ appConfig . postman . apiKey } ` ,
131116 } ,
132117 } ,
133118 )
0 commit comments