Render Templates content

Add the following code to ./template/new-email-1.php to enable developers to retrieve template content effectively.

<?php

use NewEmail1;

defined( 'ABSPATH' ) || exit;

$template = YourNewEmail::get_instance()->template;

if ( ! empty( $template ) ) {
    $content = $template->get_content( $args );
    yaymail_kses_post_e( $content );
}

The args variable is an input parameter for the get_content_html function within this file. It contains various email details, including the order, email heading, additional content, sent to admin, plain text, and more...

Upon receiving the specified variable, this code checks whether the template exists. If it does, the code retrieves the content based on args passed in

Last updated

Was this helpful?