cross-solution / cross-solution.de

Homepage of CROSS Solution uses Strapi Backend cross-solution/cms
https://cross-solution.de
MIT License
2 stars 11 forks source link

Create a contact us page #3

Closed cbleek closed 4 years ago

cbleek commented 4 years ago

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.

YogeshSinghChouhan commented 4 years ago

Can we use a micro service in node js for sending the form via email ?

cbleek commented 4 years ago

I don't know what a micro servise is.

YogeshSinghChouhan commented 4 years ago

Means a function (API) written in node js

cbleek commented 4 years ago

yes. That sounds good.

cbleek commented 4 years ago

/cc @TiSiE

YogeshSinghChouhan commented 4 years ago

@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?

cbleek commented 4 years ago

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.

wkorolew commented 4 years ago

please check

YogeshSinghChouhan commented 4 years ago

@cbleek So shall i made a function there performance feedback for sending email having input as email and output as success/failure?

TiSiE commented 4 years ago

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?

YogeshSinghChouhan commented 4 years ago

@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?

cbleek commented 4 years ago

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

Bildschirmfoto 2019-12-05 um 21 53 41

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

cbleek commented 4 years ago

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)

YogeshSinghChouhan commented 4 years ago

@cbleek Shall i debug ?

cbleek commented 4 years ago

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

cbleek commented 4 years ago

@calmcalmdown I've merged your changes. https://github.com/cross-solution/cross-solution.de/pull/50

So your test job was successfully