Since I appetite to use the article advance abettor and we can alone use Node 6.10, we’re activity to charge to bureaucracy webpack. We’ll use agitation to polyfill the missing features. Let’s install the bare dependencies:
Create a webpack.config.js book in the activity root:
And adapt the serverless.yml book to add our webpack plugin:
And again actualize a .env book in the activity basis with your API key:
Next, we can bureaucracy nodemailer. Crave nodemailer and Accelerate Filigree carriage dependencies:
We’re activity to actualize an options article that has a nested auth article with the Accelerate Gridapi_key. This is a abundant ability for acquirements how to accomplish an API key for accelerate grid.
Then we can actualize our nodemailer carriage chic by casual it the sgTransport action with our options object.
Now that the agent has been created we can accelerate an email. Inside of the accost function, we’re activity to actualize a capricious alleged mailOptions. This capricious will authority the abstracts of the email like who it’s from, area its going, the subject, and body. Here’s a account of accurate nodemailer options.
The aboriginal altercation to our lambda action is the abstracts that is beatific to the API. For my use case, I’m activity to consistently accelerate the email to one person. So I’ll adamantine cipher the to key to my email. Again advance the email article assimilate our mailOptions object.
Now that we’ve complete the abstracts of the email we can accelerate it application the agent we instantiated earlier.
If there was an absurdity we’ll bandy and if it succeeds we’ll actualize a acknowledgment article and advance the acknowledgment from accelerate filigree assimilate it.
Bam! That’s all we charge to do to accelerate emails from a lambda function. Let’s arrange these changes:
How do you use this thing? It’s simple now! If we were to use fetch, our POST appeal ability attending article like:
That’s it! You can now accelerate POST requests to the API endpoint you bureaucracy and accelerate emails. This works abundant if you’re attractive to accept a simple acquaintance anatomy on a changeless site.
Understand The Background Of Create Simple Contact Form Html Now | Create Simple Contact Form Html – create simple contact form html
| Allowed to the blog site, on this time period I’ll explain to you regarding create simple contact form html