Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x]: Allow BCC'd Recipient, Email Subject, and Reply-To in Commerce Email Settings to Use Environment Variables #3823

Closed
romainpoirier opened this issue Dec 19, 2024 · 2 comments

Comments

@romainpoirier
Copy link

What happened?

Description

In the Commerce Settings > Emails section, only the Status Email Address and From Name can currently be set as environment variables.

On my staging environment, I need the BCC’d Recipient to differ from production. However, since the /admin/commerce/settings/emails/primary/1 section is not accessible when CRAFT_ALLOW_ADMIN_CHANGES=false (which is the expected setting for staging), I cannot modify this value.

Why does Craft Commerce not allow additional email options, such as BCC’d Recipient, Email Subject, and Reply-To, to be defined as environment variables? Is this an oversight?

Is there an alternative solution, such as defining these settings via config/commerce.php? If yes, what are the exact keys to use? The BCC’d Recipient option, for instance, is not documented here: Commerce 5.x Configuration

In my case, being able to set BCC’d Recipient as an environment variable is crucial. However, having the ability to set Email Subject and Reply-To in the same way would be highly beneficial.

Steps to reproduce

  1. Set up a staging environment with CRAFT_ALLOW_ADMIN_CHANGES=false.
  2. Attempt to configure the BCC’d Recipient for Commerce Emails to differ from production.
  3. Notice that this value cannot be set via environment variables or the config/commerce.php file.

Expected behavior

The BCC’d Recipient, Email Subject, and Reply-To fields should support the use of environment variables for easier configuration across environments (staging, production, etc.).

Actual behavior

These fields cannot be defined as environment variables, and there is no documented alternative to set them via the configuration file. This limits flexibility, especially in non-production environments where admin changes are restricted.

Craft CMS version

5.5.3

Craft Commerce version

5.2.6

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@lukeholder
Copy link
Member

lukeholder commented Dec 27, 2024

Duplicate of #3823

This has been added to the next release of Commerce (5.3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants