Skip to content

Commit

Permalink
How to send email from WordPress to Buggregator
Browse files Browse the repository at this point in the history
  • Loading branch information
soderlind committed Jun 5, 2024
1 parent c514817 commit be27ed5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
28 changes: 27 additions & 1 deletion docs/config/smtp.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,30 @@ or
bin/magento config:set system/smtp/transport smtp
bin/magento config:set system/smtp/host 127.0.0.1
bin/magento config:set system/smtp/port 1025
```
```

## WordPress

Save the following code to a file in the [mu-plugins](https://developer.wordpress.org/advanced-administration/plugins/mu-plugins/) directory (e.g. `smtp.php`):

```php
<?php
/**
* Plugin Name: MU Buggregator SMTP
*/

if (! defined('WP_ENVIRONMENT_TYPE') || 'local' !== WP_ENVIRONMENT_TYPE) {
return;
}

/**
* Send emails to Buggregator
*
* @param \PHPMailer $phpmailer The PHPMailer instance (passed by reference).
*/
add_action( 'phpmailer_init', function( $phpmailer ) : void {
$phpmailer->isSMTP();
$phpmailer->Host = '127.0.0.1';
$phpmailer->Port = 1025;
} );
```
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@
"@docsearch/css" "3.5.2"
algoliasearch "^4.19.1"

"@esbuild/linux-x64@0.18.20":
"@esbuild/darwin-arm64@0.18.20":
version "0.18.20"
resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz"
integrity sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==
resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz"
integrity sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==

"@jridgewell/sourcemap-codec@^1.4.15":
version "1.4.15"
Expand Down Expand Up @@ -395,6 +395,11 @@ focus-trap@*, focus-trap@^7.5.4:
dependencies:
tabbable "^6.2.0"

fsevents@~2.3.2:
version "2.3.3"
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz"
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==

jsonc-parser@^3.2.0:
version "3.2.0"
resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz"
Expand Down

0 comments on commit be27ed5

Please sign in to comment.