Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

ADR #14: Email with order resume

Pablo Lopez edited this page Apr 30, 2022 · 3 revisions

Email with order resume

Status

Accepted

Context

We want a functionality that will send an email to the user after an order is created with the order information on it.

Decision

We implement it using a node module called html-pdf, which allowed us to create a pdf from a html file (that was created dynamically) and then send it to the user.

Consequences

This approach was working on develop mode but when sending to production there was an error with the phantomjs on the docker container that wasn't allowing the module to work, so we had to change our approach.

Then we tried creating a PDF dynamically, mostly the same way than before but storing it and afterwards sending it but we weren't capable of taking an exisiting file and attach it to the email so we had to deprecate that option too.

After all tahat, as it isn't one of the requierement, we decided to send the email and at the end of it, the order resume in plain html is shown, therefore the user gets the information of the order as we wanted, eventhough is not the best approach, the final goal is met.

Finally, as at midterm, the email sending API stopped working without any apparental reason. So we manage to create a button, and when clicked, through a http request, a PDF with the resume of the order is shown to the user

Clone this wiki locally