Send e-mail messages for payments requiring invoices #52
Labels
back-end
Issue related to the back end logic of the application
payment-interface
Issues related to the payment interface
Until #44 gets solved (which might take a while), there's an alternative way in which we could issue invoices for payers using a didactic career premium card. The idea is to send an e-mail to an employee (at the University's Financial Department) who is already responsible for generating invoices for those paying by didactic premium card at the University's cash desk. The employee in question will input the payment information received by e-mail into the EMSYS desktop client app, generate the invoice in the platform and then manually send it back to the payer (again by e-mail).
For these purposes, we've got an unmonitored account created in the University's Microsoft 365 tenant, called
[email protected]
. I've asked the tenant administrator to add theMail.Send
permission to our app's registration (the same client ID we're using for logging in users) and to configure Exchange Online to allow our app to send mails using that no-reply address.The steps to send a message from the back end are as follows:
Authenticate against the Microsoft 365 tenant using the application credentials (i.e. the OAuth 2.0 client credentials flow). See this tutorial on how to do so from the Node.js server side.
Use the Microsoft Graph
sendMail
API call to send the message. Might be easier to do so by using the Microsoft Graph SDK for JavaScript (they've got an example for how to send an e-mail message right in their readme).For every payment performed using a didactic career premium card, we should send two messages (after the EuPlătesc callback confirms us that they were successfuly performed):
A message to the payer, informing them that the payment has been successfully processed and that they will receive their invoice in 5-10 working days.
A message to the employee from the Financial Department (this address could be hard-coded or stored in the app's settings) with the payment information (amount paid, first name, last name, personal code, address etc.)
The text was updated successfully, but these errors were encountered: