<p>Could you use the <code>testToEmailAddress</code> config setting in your <code>config.php</code>? As this will send all emails to a single address. </p>

<p><code>'testToEmailAddress' =&gt; getenv('TEST_TO_EMAIL_ADDRESS')</code></p>

<p>Then in your <code>.env</code> set:</p>

<p><code>TEST_TO_EMAIL_ADDRESS="email@email.com"</code></p>

CC BY-SA 4.0
2019-02-19T16:05:43.937Z
2019-02-20T09:28:42.220Z
2019-02-20T09:28:42.220Z
Jason Mayo
<p>We're just in the process of upgrading from Craft 2 with Commerce 1 to Craft 3 and Commerce 2. One of the issues we had before was that the client was getting confirmation emails for test orders.</p>

<p>Is it possible to set the confirmation email destination in the .env file so our team can set themselves as the target emails for their own local testing?</p>

<p>Thanks!</p>

<plugin-craftcommerce><multi-environment><plugin-craftcommerce2>
How to set Commerce 2 confirmation email in .env file?
# How to set Commerce 2 confirmation email in .env file?

(Asked by: username_0 on 2019-02-19)

We're just in the process of upgrading from Craft 2 with Commerce 1 to Craft 3 and Commerce 2. One of the issues we had before was that the client was getting confirmation emails for test orders.

Is it possible to set the confirmation email destination in the .env file so our team can set themselves as the target emails for their own local testing?

Thanks!

**Tags:** plugin-craftcommerce, multi-environment, plugin-craftcommerce2


---

## 1 answers

### Answer by username_1 on 2019-02-19. Score: 2

Could you use the `testToEmailAddress` config setting in your `config.php`? As this will send all emails to a single address.

`'testToEmailAddress' => getenv('TEST_TO_EMAIL_ADDRESS')`

Then in your `.env` set:

`TEST_TO_EMAIL_ADDRESS="email@email.com"`


---

