Skip to content

Commit

Permalink
Update mail.php
Browse files Browse the repository at this point in the history
  • Loading branch information
takayukister committed Feb 11, 2023
1 parent 5bef558 commit 1d742ef
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions includes/mail.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

/**
* Class that represents an attempt to compose and send email.
*/
class WPCF7_Mail {

private static $current = null;
Expand All @@ -10,10 +13,23 @@ class WPCF7_Mail {
private $use_html = false;
private $exclude_blank = false;


/**
* Returns the singleton instance of this class.
*/
public static function get_current() {
return self::$current;
}


/**
* Composes and sends email based on the specified template.
*
* @param array $template Array of email template.
* @param string $name Optional name of the template, such as
* 'mail' or 'mail_2'. Default empty string.
* @return bool Whether the email was sent successfully.
*/
public static function send( $template, $name = '' ) {
self::$current = new self( $name, $template );
return self::$current->compose();
Expand Down

0 comments on commit 1d742ef

Please sign in to comment.