Download the PHP package anthonybudd/wp_mail without Composer

On this page you can find all versions of the php package anthonybudd/wp_mail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp_mail

WP_Mail - Send Dynamic Templated Emails with WordPress

WP_Mail is the most popular, simplest and powerful dynamic email class available for WordPress. The class provides simple methods for attaching files, custom headers and lots of helper functions. The class only sends emails using the WordPress function wp_mail() , this means that all of your existing SMTP settings will continue to work with no additional config or set-up required.

email.html


Installation

Require WP_Mail with composer

Or

Download the WP_Mail class and require it at the top of your functions.php file.


Methods

to(), cc(), bcc()

All of these functions allow you to set an array or string of recipient(s) for your email as shown in the example below.

subject()

To set the subject field use the subject function. The first argument will be the emails subject.

from()

To set the from header there is a useful helper function.

attach()

Similar to the to, cc and bcc, methods the attach method can accept a string or array of stings. This strings must be absolute file paths, this method will throw if the file does not exist.

template($templatePath, $variables = [])

The templet method is for setting the path to the html email template. The second argument is for an asoc array where the keys will correspond to your HTML email’s variables. Variables are optional and are not required for templates that do not have any variables.

templateHeader($templatePath, $variables = [])

templateFooter($templatePath, $variables = [])

Self-explanatory

If you are sending many emails the beforeTemplate() and afterTemplate() will allow you to append and prepen templated HTML to your emails.

headers()

This method allows you to set additional headers for your email. This can be an array of headers or a single string header.

render()

This method is called by the send() method, the result is given directly to the $message argument of the wp_mail function. This can be used for testing or for displaying what an email will look like for admins.

The render() method is called when you send an email will use a simple bit of regex to find and replace variables using a mustache-esque syntax. Finally the method sends the email using WordPresses built in wp_mail() function.


All versions of wp_mail with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package anthonybudd/wp_mail contains the following files

Loading the files please wait ....