Closed cbleek closed 4 years ago
Can we use a micro service in node js for sending the form via email ?
I don't know what a micro servise is.
Means a function (API) written in node js
yes. That sounds good.
/cc @TiSiE
@cbleek
1.So form html would be the input for the node api?
2.Will form contains any input field, iff yes then the data filled by user will be stored or sent to any link?
I am mainly interested in seeing how the code for sending mails is integrated. Where is the logic stored?
in our performance feedback project, you've used the nodemailer package.
Only send the form data. We don't want to store them.
please check
@cbleek So shall i made a function there performance feedback for sending email having input as email and output as success/failure?
We recently started to use strapi as our CMS-Backend. @cbleek noticed, that there is an email api build in. We want to use that api to send the emails.
But currently there is this issue When calling the api providing parameters, the request takes forever and never finishes.
@YogeshSinghChouhan Maybe you can look into that?
@TiSiE
So there is any code that you guys have written for calling strapi email api ;so i can debug?
Where can i find it?
We have a strapi based app in https://github.com/cross-solution/cms
The problem
if I consume the api via eg:
curl -X POST "http://10.10.1.28:1337/email/" -H "accept: application/json" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkZTEwOTViZDc2NDUyMGVjN2FjOGZlYSIsImlzQWRtaW4iOnRydWUsImlhdCI6MTU3NTU3ODgzMCwiZXhwIjoxNTc4MTcwODMwfQ.znNP0zamyDP3Rbuetm2K9JWQWhVlSRe5bNjaC6cs58o" -H "Content-Type: application/json" -d "{\"to\":\"bleek@cross-solution.de\"}"
I get the bearer Code from
I get sometimes a 500 error. E.g
[2019-12-05T21:07:25.641Z] debug POST /email/ (1398 ms) 200
[2019-12-05T21:07:36.759Z] error undefined
AssertionError [ERR_ASSERTION]: Cannot wrap non-Error object
at Function.boomify (/home/cbleek/Projects/strapi-cross/node_modules/strapi/node_modules/boom/lib/index.js:107:14)
at /home/cbleek/Projects/strapi-cross/node_modules/strapi/lib/middlewares/boom/index.js:80:22
at processTicksAndRejections (internal/process/task_queues.js:93:5)
please use your upwork clock, when debugging
Hi yogesh,
sending Email via the strapi api is working as expected. At least in the production system. A Mail is sent.
I can't see anything in my postfix log. I assume, mail are send via a node library directly (eg. https://www.npmjs.com/package/sendmail)
@cbleek Shall i debug ?
You can implement it. The API works as expected.
The API is located at:
https://strapi.cross-solution.de:8443/documentation/v1.0.0#/Email%20-%20Email
@TiSiE consumes the API with axios in the LoginInfo Component
You can install the strapi Backen locally https://github.com/cross-solution/cms/blob/master/README.md
@calmcalmdown I've merged your changes. https://github.com/cross-solution/cross-solution.de/pull/50
So your test job was successfully
We've created a simple contact page. Just included an example into a page.
https://quasar.cross-solution.de/contact
Source of the page.
We want to make the the page to send the form via Mail.