# EDD_Emails

 Introduced in Easy Digital Downloads version 2.1, the [EDD\_Emails](https://github.com/easydigitaldownloads/Easy-Digital-Downloads/blob/master/includes/emails/class-edd-emails.php) class handles the construction and sending of purchase receipts and admin sale notifications. It is also used by extensions to send custom emails in the standard HTML template.

 To send an email using the EDD\_Emails, class, call the *send()* method from the main *EDD()* instance, like this:

```
EDD()-&gt;emails-&gt;send( $to, $subject, $message );
```

 If you want to send attachments along with the email, pass the file paths as a string or array as a fourth parameter:

```
EDD()-&gt;emails-&gt;send( $to, $subject, $message, $attachments );
```

 All emails sent through this class will have the template selected in *Downloads &gt; Settings &gt; Emails* applied. By default, it looks like this:

 [![Screenshot from 2014-09-03 10:36:07](https://easydigitaldownloads.com/wp-content/uploads/2022/07/6184cbbcda76f.png)](https://easydigitaldownloads.com/wp-content/uploads/2014/09/Screenshot-from-2014-09-03-103607.png)

 Class properties:

- $from\_address
- $from\_name
- $content\_type
- $headers
- $html
- $template
- $heading

 Methods:

- public: \_\_set( $key, $value )
- public: get\_from\_name()
- public: get\_from\_address()
- public: get\_content\_type()
- public: get\_headers()
- public: get\_templates()
- public: get\_template()
- public: get\_heading()
- public: parse\_tags()
- public: build\_email()
- public: send()
- public: send\_before()
- public: send\_after()
- public: text\_to\_html()

 Filters:

- edd\_email\_from\_name
- edd\_email\_from\_address
- edd\_email\_content\_type
- edd\_email\_headers
- edd\_email\_templates
- edd\_email\_template
- edd\_email\_heading
- edd\_email\_message
- edd\_email\_attachments

 Actions:

- edd\_email\_header
- edd\_email\_template\_{template name}
- edd\_email\_body
- edd\_email\_footer
- edd\_email\_send\_before
- edd\_email\_send\_after