jimderonde / wp-mailer
Composer package for Gewest13's Wordpress mailer.
Installs: 308
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
pkg:composer/jimderonde/wp-mailer
Requires
- phpmailer/phpmailer: ^6.1
- vlucas/phpdotenv: ^4.1
- dev-master
- 2.4.0
- 2.3.1
- 2.3.0
- 2.2.6
- 2.2.5
- 2.2.3
- v2.2.1
- v2.2.0
- 2.1.1
- 2.1
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.3.45
- 1.3.44
- 1.3.43
- 1.3.42
- 1.3.41
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3
- 1.2
- 1.1
- dev-codex/fix-contact-form-loading-issue
- dev-codex/add-recaptcha-score-check
- dev-develop
- dev-dependabot/composer/phpmailer/phpmailer-6.5.0
This package is auto-updated.
Last update: 2025-11-28 09:43:20 UTC
README
This is a Wordpress module developed by Jim de Ronde (Gewest13).
Prerequisites
- ACF Pro
Installation
Do this first.
- Clone the repository in your
server/directory. - Do a
composer installinside the folder. - Require or include the
server/wp-mailer/autoload.phpinto yourfunctions.phpfile. - Please note that a hook within Wordpress is including a javascript file into the footer. Import it as you like whenever you desire a bundle over multiple javascript files.
When this is done a first form can be added.
- Create a
.envfile in the root of your template folder with the credentials as presented in the example file.example.env. - Create a new form and add any field to your liking.
- Add the
/sample-component/to your list of components/. Please note that the form will require some predefined settings like anaction,data-wp-mailerandmethod. - At last, please include
wp_footer()before the ending of your</body>tag. Please not that the entire function will be cleared and will only return the javascript file that will take care of the asynchronous requests. - If desired, add the following rule to your
.cssfile in order to hide the badge:.grecaptcha-badge {display: none}
Environment variables
MAIL_FROM_EMAILlets you override the sender email used when dispatching messages (useful when your SMTP provider requires a specific from address such as Resend). When not set, the SMTP username is used as the sender while replies continue to go to the original form email when different.RECAPTCHA_MIN_SCOREallows you to configure the minimum acceptable reCAPTCHA v3 score (defaults to0.5).
Functions
Always check if $mailer is a valid instance of the Mailer class.
- Use
$mailer->getForm($id)to get all form fields. - Then, use a
foreachloop to loop through all fields.foreach ($mailer->getForm($id) as $name => $field). - Inside the loop the
$field->fieldvariable will contain the entire html element so use$mailer->parseField($field->field, "classes")to parse it. - Label can be accessed through
$field->label. - Name can be accessed through
$field->name. - Field type can be accessed through
$field->type.