-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
/** | ||
* Review approve email. | ||
* | ||
* @package HivePress\Emails | ||
*/ | ||
|
||
namespace HivePress\Emails; | ||
|
||
use HivePress\Helpers as hp; | ||
|
||
// Exit if accessed directly. | ||
defined( 'ABSPATH' ) || exit; | ||
|
||
/** | ||
* Review approve email class. | ||
* | ||
* @class Review_Approve | ||
*/ | ||
class Review_Approve extends Email { | ||
|
||
/** | ||
* Class initializer. | ||
* | ||
* @param array $meta Form meta. | ||
*/ | ||
public static function init( $meta = [] ) { | ||
$meta = hp\merge_arrays( | ||
[ | ||
'label' => esc_html__( 'Review Approved', 'hivepress-reviews' ), | ||
'recipient' => hivepress()->translator->get_string( 'user' ), | ||
'tokens' => [ 'user_name', 'listing_title', 'listing_url', 'user', 'listing', 'review' ], | ||
], | ||
$meta | ||
); | ||
|
||
parent::init( $meta ); | ||
} | ||
|
||
/** | ||
* Class constructor. | ||
* | ||
* @param array $args Email arguments. | ||
*/ | ||
public function __construct( $args = [] ) { | ||
$args = hp\merge_arrays( | ||
[ | ||
'subject' => esc_html__( 'Review Approved', 'hivepress-reviews' ), | ||
'body' => esc_html__( 'Hi, %user_name%! Your review for "%listing_title%" has been approved, click on the following link to view it: %listing_url%', 'hivepress-reviews' ), | ||
], | ||
$args | ||
); | ||
|
||
parent::__construct( $args ); | ||
} | ||
} |