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

Custom MAIL environment variables being overwritten when Outgoing mail is disabled. #20

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

sincilite
Copy link

We experienced a bug where the environment variables set in Platform.sh for the project's environment were being ignored when outgoing emails using P.sh's own SendGrid SMTP host.

The documentation says that disabling email through the project's settings UI sets the value of PLATFORM_SMTP_HOST to an empty string. Though testing on the instance suggests that the value is set to false.

Either way, the check previously was only looking at the existence of the config variable which meant project environment vars were always being overwritten with defaults set in the mapPlatformShMail function even when the values were not set.

I've switched the check to use empty() which allows the custom environment variables to be set correctly.

@sincilite sincilite changed the title Custom MAIL environment variables not being overwritten when Outgoing mail is disabled. Custom MAIL environment variables being overwritten when Outgoing mail is disabled. Nov 17, 2023
@budda
Copy link

budda commented Dec 7, 2023

Ah looks like this pull request might fix #21 !

@budda
Copy link

budda commented Dec 8, 2023

Any update on wether this fix works and will be made available in a new release?

@sincilite
Copy link
Author

@budda We're running my fork in our Laravel based app running on Platform.sh. Mail settings are honoured and we're happy everything is working OK

@budda
Copy link

budda commented Dec 10, 2023

@budda We're running my fork in our Laravel based app running on Platform.sh. Mail settings are honoured and we're happy everything is working OK

@sincilite what's the correct syntax for composer to pull in this fork of the laravel-bridge package whilst waiting for a merge? I've tried loads and nothing seems to work, always ends with:-


  Problem 1
    - Root composer.json requires sincilite/laravel-bridge, it could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it```

@sincilite
Copy link
Author

You'll need to set a repositories block in your composer.json file.

"repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/sincilite/laravel-bridge"
        }
    ],

and update your platformsh/laravel-bridge dependency to be platformsh/laravel-bridge: "dev-master"

You might need to set your minimum stability requirement to be "minimum-stability": "dev"

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/sincilite/laravel-bridge"
        }
    ],
    "require": {
        "platformsh/laravel-bridge": "dev-master",
    },
    "minimum-stability": "dev",
}

@budda
Copy link

budda commented Dec 11, 2023

Thanks @sincilite - the minor detail was:

and update your platformsh/laravel-bridge dependency to be platformsh/laravel-bridge: "dev-master"

i had changed the dependency to be sincilite/laravel-bridge: dev-master 🤦🏻

Also confirmed this PR fixes my problem with using AWS SES on PSH. Many thanks for sorting it @sincilite 👍🏻

@chadwcarlson
Copy link
Contributor

chadwcarlson commented Dec 12, 2023

Closes #21

Thank you @budda and @sincilite!

@chadwcarlson chadwcarlson merged commit 1e3312f into platformsh:master Dec 12, 2023
4 checks passed
@budda
Copy link

budda commented Dec 19, 2023

@chadwcarlson are we getting a new tagged release of the package?

@chadwcarlson
Copy link
Contributor

chadwcarlson commented Dec 19, 2023

@budda - moved too fast. 🙇 https://github.com/platformsh/laravel-bridge/releases/tag/2.2.2

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

Successfully merging this pull request may close these issues.

3 participants