mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 21:34:24 +00:00
add mail notification if processing fails
This commit is contained in:
@@ -46,6 +46,37 @@ class TicketGenerator {
|
||||
} );
|
||||
}
|
||||
|
||||
sendErrorMail( order, email ) {
|
||||
db.getJSONData( 'rootAccount' ).then( res => {
|
||||
( async() => {
|
||||
const app = createSSRApp( {
|
||||
data() {
|
||||
return {
|
||||
host: settings.yourDomain,
|
||||
pageName: settings.name,
|
||||
};
|
||||
},
|
||||
template: '' + fs.readFileSync( path.join( __dirname + '/../../ui/en/payments/failedToProcessMail.html' ) )
|
||||
} );
|
||||
|
||||
mailManager.sendMail( email, await renderToString( app ), 'Your order failed to process', settings.mailSender );
|
||||
|
||||
const adminNot = createSSRApp( {
|
||||
data() {
|
||||
return {
|
||||
host: settings.yourDomain,
|
||||
email: email,
|
||||
order_id: order,
|
||||
};
|
||||
},
|
||||
template: '' + fs.readFileSync( path.join( __dirname + '/../../ui/en/payments/failedToProcessDetailsMail.html' ) )
|
||||
} );
|
||||
|
||||
mailManager.sendMail( res.email, await renderToString( adminNot ), 'Your order failed to process', settings.mailSender );
|
||||
} )();
|
||||
} );
|
||||
}
|
||||
|
||||
generateTickets ( order ) {
|
||||
this.ticketQueue[ this.jobId ] = { 'order': order };
|
||||
this.runningTickets[ order.tok ] = 'processing';
|
||||
|
||||
Reference in New Issue
Block a user