Email::template_form( string $active )
Description #
Generate email template form.
Parameters #
- $activestring (Required) Currently active template.
Source #
File: addons/email/email.php
public function template_form( $active ) { $form = anspress()->get_form( 'email_template' ); $template = get_post( ap_opt( 'email_template_' . $active ) ); if ( $template ) { $form->set_values( array( 'subject' => $template->post_title, 'body' => $template->post_content, ) ); } else { $default_template = $this->get_default_template( $active ); $form->set_values( array( 'subject' => $default_template['subject'], 'body' => $default_template['body'], ) ); } $form->generate( array( 'ajax_submit' => true, 'hidden_fields' => array( array( 'name' => 'action', 'value' => 'ap_ajax', ), array( 'name' => 'ap_ajax_action', 'value' => 'form_email_template', ), array( 'name' => 'template', 'value' => $active, ), ), ) ); }
Expand full source code Collapse full source code View on GitHub: addons/email/email.php:801
Add your comment