import { EMAIL_TEMPLATE_ID } from 'common/enums' ; import { environment } from 'common/environment' ; import { notificationQueue } from 'connectors/queue/notification' ; import { LANGUAGES } from 'definitions' ; import { trans } from './utils' ; export const sendPayment = async ( { to , type , recipient , tx , language = 'zh_hant' , } ) => { const templateId = EMAIL_TEMPLATE_ID . payment [ language ] ; const subject = trans . payment [ type ] ( language , { } ) ; notificationQueue . sendMail ( { from : environment . emailFromAsk as string , templateId , personalizations : [ { to , dynamic_template_data : { subject , siteDomain : environment . siteDomain , type : { passwordSet : type === 'passwordSet' , passwordChanged : type === 'passwordChanged' , creditAdded : type === 'creditAdded' , donated : type === 'donated' , receivedDonation : type === 'receivedDonation' , receivedDonationLikeCoin : type === 'receivedDonationLikeCoin' , payout : type === 'payout' , } , recipient , tx , } , } , ] , } ) ; } ;