-
Notifications
You must be signed in to change notification settings - Fork 275
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
Support wp_mail() #276
Comments
How weird is that What I think is happening is this:
Let's keep this issue open to track the |
My guess: Installing Google fonts involves network calls. Playground in the browser doesn't support that at the moment because of CORS and SSL problems – see the related issue. Can the Google fonts feature be disabled for now? |
That makes sense, thanks for explaining! Yes, we could disable adding Google fonts, as there is also the ability to add local fonts which works well with Playground. Maybe we could disable Google fonts if the plugin is on a Playground instance for now. Thanks for your help. Happy for this to be closed as a duplicate of #85. |
Oh I've just seen your first comment! I'm sure that wasn't there before, I'm going to blame GitHub 😅
Ok! We'll take a look at the |
Thinking about Playground - it would be good to turn that fatal error into a warning somewhere here: wordpress-playground/packages/php-wasm/compile/build-assets/phpwasm-emscripten-library.js Line 386 in 388e805
|
I mentioned this issue to Adam during WCEU - and came here to open a new issue; good to know it is documented and is being discussed. |
cc @dmsnell – you might be interested this issue as it touches the major PHP/JavaScript integration points |
we may not be able to support sending email in the browser without a socket layer that can be used for TCP. this probably mirrors the mysql issues. maybe a good start, in addition to any error reporting, is to disable sending emails from WordPress by default. there are some plugins out there to do that, but I don't see a simple way in WordPress to toggle them off. maybe if we included a plugin to do this we could prevent a number of email-related bugs. |
I saw this repo recently, which could be useful in figuring out how to disable all emails. WordPress Email Documentation - https://github.com/johnbillion/wp_mail
|
wasm_popen: mode 'w' not supported
Calling <?php
require "/wordpress/wp-load.php";
wp_mail("[email protected]", "Subject", "Message");
echo 'done'; Under the hood, playground.setSpawnHandler(
((command: string, processApi: any) => {
if (command.startsWith('/usr/bin/env stty size ')) {
processApi.stdout(`18 140`);
processApi.exit(0);
} else if (command.startsWith('less')) {
processApi.on('stdin', (data: Uint8Array) => {
processApi.stdout(data);
});
processApi.flushStdin();
processApi.exit(0);
}
}).toString()
); |
The original problem related to the Create Block Theme is also fixed. Google fonts may be used whenever the networking support is enabled. |
This issue is very specific to using the Create Block Theme plugin on a WordPress Playground instance, so it could be that there needs to be a fix in that plugin instead/as well!
Create Block Theme allows you to add font files to your WordPress install. When I add a Google font in a Playground instance, I'm seeing the following error:
wasm_popen: mode 'w' not supported (cmd: /usr/sbin/sendmail -t -i)!
I think this is because the 'w' mode is not supported by Playground WebAssembly implementation, or perhaps it's a permissions issue. I wondered if there was a possible fix for this or a way around this from the Create Block Theme side.
To reproduce:
The text was updated successfully, but these errors were encountered: