Emails
Creating emails
<?php
namespace HivePress\Emails;
use HivePress\Helpers as hp;
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
class Foo_Bar extends Email {
public function __construct( $args = [] ) {
// Set the default subject and message.
$args = hp\merge_arrays(
[
'subject' => 'Custom subject',
'body' => 'Custom message with a %custom_token%.',
],
$args
);
parent::__construct( $args );
}
public static function init( $meta = [] ) {
// Add details for the email editor.
$meta = hp\merge_arrays(
[
'label' => 'My Custom Email',
],
$meta
);
parent::init( $meta );
}
}
Sending emails
Customizing emails
Last updated