AnsPress_Email_Hooks::template_form( string $active )
Description #
Generate email template form.
Parameters #
- $activestring (Required) Currently active template.
Source #
File: addons/free/email.php
public static 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 = self::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( [ 'name' => 'action', 'value' => 'ap_ajax' ], [ 'name' => 'ap_ajax_action', 'value' => 'form_email_template' ], [ 'name' => 'template', 'value' => $active ], ), )); }
Expand full source code Collapse full source code View on GitHub: addons/free/email.php:719
Add your comment