<p><a href="https://craftcms.com/classreference/services/HttpRequestService" rel="noreferrer">HttpRequestService</a>'s <a href="https://craftcms.com/classreference/services/HttpRequestService#getPost-detail" rel="noreferrer">getPost</a> is what you're looking for:</p>

<pre><code>$value = craft()-&gt;request-&gt;getPost('dataName');
</code></pre>

CC BY-SA 3.0
2016-07-16T07:55:38.010Z
Or you can get all the POST data in one go with

`$vars = craft()->request->getPost();`
Jeremy Daalder
CC BY-SA 3.0
2016-07-16T07:56:56.077Z
You may also want to look at https://github.com/bossanova808/CommerceMailer for some stuff to get you started in this area...
Jeremy Daalder
CC BY-SA 3.0
2016-07-15T18:06:25.947Z
2016-07-15T18:06:25.947Z
Brad Bell
<p>In CraftCMS 3.x <code>craft.app.request.getBodyParam('dataName')</code></p>

CC BY-SA 4.0
2021-05-18T07:45:40.667Z
2021-05-18T07:45:40.667Z
Yurii Kosiak
<p>I am trying to create a plugin that takes the POST data from an order and emails it to the end user. Which property should I use to do this? I've already tried to use <code>getContent()</code> and <code>getContentFromPost()</code>.</p>

<p>So for example if I have </p>

<pre><code>         &lt;input type="text" name="dataName" value=""&gt;
</code></pre>

<p>And in my plugin I'm trying to get the value of "dataName" which property should I use?</p>

<plugin-craftcommerce>
Getting Information from POST data
# Getting Information from POST data

(Asked by: username_0 on 2016-07-15)

I am trying to create a plugin that takes the POST data from an order and emails it to the end user. Which property should I use to do this? I've already tried to use getContent() and getContentFromPost().
So for example if I have 
         

And in my plugin I'm trying to get the value of "dataName" which property should I use?

**Tags:** plugin-craftcommerce


---

## 2 answers

### Answer by username_1 on 2016-07-15. Score: 5

HttpRequestService's getPost is what you're looking for:
$value = craft()->request->getPost('dataName');

> **Comments:**
> **username_2**: Or you can get all the POST data in one go with  `$vars = craft()->request->getPost();`  
> **username_2**: You may also want to look at https://github.com/bossanova808/CommerceMailer for some stuff to get you started in this area...  

---

### Answer by username_3 on 2021-05-18. Score: 2

In CraftCMS 3.x `craft.app.request.getBodyParam('dataName')`


---

