Hello dear all,
I am trying to send an automatic answer email on my app and I did not find anything already done in the forum neither in the function market.
HTML code working:
Java script node not working:
I think this is probably something simple to solve and that can help others who have the same issue.
Thank you all, you are awesome!
Can’t help on the Java code, but you could also explore another approach.
You could use HTTP request to send content of email in JSON to your account in SendGrid or MailJet.
Another simpler approach could be also to create Integromat webhook and connect it to Gmail inside of Integromat (in case of low email volume).
Yes, Thank you for the tip, but I also would like to know what is going wrong in the JS code.
This is the first time that I am trying to do something with the JS node and it is frustating not knowing what is the problem, because next time that I face the same problem, I will again get stuck on it.
@Greg_F and @Sasu_Makinen,
I tried to use sendgrid and mailjet, but they work in cURL, PHP, NODE, RUBY, PYTHON, GO, C#, and JAVA.
I still can’t figure it out how to setup all the post request in appgyver as the information on, for example, MailJet API documentation is different from the one available on appgyver.
I got confused because both SendGrid and MailJet API documentation says that I have to have cURL installed on my machine or use an official library.
How is this supposed to work? I am totally lost here…
Can you help me understanding and informing what should I put on relative path, response key path and if I need to use a HTTP Header, URL placeholder and Query parameter?
@Sasu_Makinen right… once you are a level 3 wizzard… For common folk it is a pure trickery …
cURL is just a piece of software that you use to make HTTP requests.
BTW your browser is also a software that does HTTP requests… cURL just helps to add more parameter to the HTTP request.
To send your email via SendGrid or MailJet you need to make a HTTP .
Appgyver is making also HTTP requests in at least 3 ways:
via Rest API data module - but this should be used when you expect to recieve data as response to your HTTP request and further use this data in your app
via HTTP request module in components - this is probably what you should use
via JS block when you can code the request yourself (using fetch () command )
To know you what parameters to use for the request you use cURL syntax as quide:
Request path (or target URL or just URL
type of request
POST (as on picture above) headers
Json body of the message
looks like there is also authentication needed using your private and public key
@Sasu_Makinen Can appgyver http request component add user for authentication?
If above doesnt work, you can make HTTP request to Mailjet using fetch() in JS component and above parameters.
Here are details of using fetch:
Thank you for the explanation.
My issue was that I didn’t know the existence of the HTTP request module in components.
Now, it is working perfectly.