| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
|
| 6 |
$email_styles = FrmEmailStylesController::get_email_styles(); |
| 7 |
$selected_style = ! empty( $form_action->post_content['email_style'] ) ? $form_action->post_content['email_style'] : 'classic'; |
| 8 |
|
| 9 |
if ( ! empty( $form_action->post_content['plain_text'] ) ) { |
| 10 |
$selected_style = 'plain'; |
| 11 |
} |
| 12 |
|
| 13 |
$default_style = FrmEmailStylesController::get_default_email_style(); |
| 14 |
?> |
| 15 |
<p class="frm-email-style-container frm-mt-xs frm-mb-md"> |
| 16 |
<label for="frm-email-style-value"> |
| 17 |
<?php esc_html_e( 'Email Style', 'formidable' ); ?> |
| 18 |
</label> |
| 19 |
<select name="<?php echo esc_attr( $this->get_field_name( 'email_style' ) ); ?>" id="frm-email-style-value"> |
| 20 |
<?php |
| 21 |
foreach ( $email_styles as $style_key => $style ) { |
| 22 |
$option_attrs = array( 'value' => $style_key ); |
| 23 |
$option_label = $style['name']; |
| 24 |
|
| 25 |
if ( empty( $style['selectable'] ) ) { |
| 26 |
$option_attrs['disabled'] = 'disabled'; |
| 27 |
$option_label .= ' ' . __( '(Pro)', 'formidable' ); |
| 28 |
} |
| 29 |
|
| 30 |
if ( $style_key === $default_style ) { |
| 31 |
$option_label .= ' ' . __( '(Default)', 'formidable' ); |
| 32 |
} |
| 33 |
|
| 34 |
printf( |
| 35 |
'<option %1$s%2$s>%3$s</option>', |
| 36 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 37 |
FrmAppHelper::array_to_html_params( $option_attrs ), |
| 38 |
selected( $selected_style, $style_key, false ), |
| 39 |
esc_html( $option_label ) |
| 40 |
); |
| 41 |
}//end foreach |
| 42 |
?> |
| 43 |
</select> |
| 44 |
</p> |
| 45 |
|
| 46 |
<p class="frm_bcc_cc_container frm-mb-0"> |
| 47 |
<a href="javascript:void(0)" class="button frm_email_buttons frm_cc_button <?php echo esc_attr( ! empty( $form_action->post_content['cc'] ) ? 'frm_hidden' : '' ); ?>" data-emailrow="cc"> |
| 48 |
<?php esc_html_e( 'CC', 'formidable' ); ?> |
| 49 |
</a> |
| 50 |
<a href="javascript:void(0)" class="button frm_email_buttons frm_bcc_button <?php echo esc_attr( ! empty( $form_action->post_content['bcc'] ) ? 'frm_hidden' : '' ); ?>" data-emailrow="bcc"> |
| 51 |
<?php esc_html_e( 'BCC', 'formidable' ); ?> |
| 52 |
</a> |
| 53 |
</p> |
| 54 |
|
| 55 |
<p class="frm_has_shortcodes frm_to_row frm_email_row frm-mb-md"> |
| 56 |
<label class="frm-h-stack-xs" for="<?php echo esc_attr( $this->get_field_id( 'email_to' ) ); ?>"> |
| 57 |
<span><?php esc_html_e( 'To', 'formidable' ); ?></span> |
| 58 |
<span <?php FrmAppHelper::maybe_add_tooltip( 'email_to' ); ?>><?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_icon frm_svg14' ); ?></span> |
| 59 |
</label> |
| 60 |
<input type="text" name="<?php echo esc_attr( $this->get_field_name( 'email_to' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['email_to'] ); ?>" class="frm_not_email_to large-text" id="<?php echo esc_attr( $this->get_field_id( 'email_to' ) ); ?>" /> |
| 61 |
</p> |
| 62 |
|
| 63 |
<p class="frm_has_shortcodes frm_cc_row frm_email_row frm-mb-md<?php echo ! empty( $form_action->post_content['cc'] ) ? '' : ' frm_hidden'; ?>"> |
| 64 |
<label class="frm-h-stack-xs" for="<?php echo esc_attr( $this->get_field_id( 'cc' ) ); ?>"> |
| 65 |
<span><?php esc_html_e( 'CC', 'formidable' ); ?></span> |
| 66 |
<span <?php FrmAppHelper::maybe_add_tooltip( 'cc' ); ?>><?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_icon frm_svg14' ); ?></span> |
| 67 |
</label> |
| 68 |
<input type="text" name="<?php echo esc_attr( $this->get_field_name( 'cc' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['cc'] ); ?>" class="frm_not_email_to large-text" id="<?php echo esc_attr( $this->get_field_id( 'cc' ) ); ?>" /> |
| 69 |
<a href="javascript:void(0)" class="frm_remove_field" data-emailrow="cc"><?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon frm_svg14' ); ?></a> |
| 70 |
</p> |
| 71 |
|
| 72 |
<p class="frm_has_shortcodes frm_bcc_row frm_email_row frm-mb-md<?php echo ! empty( $form_action->post_content['bcc'] ) ? '' : ' frm_hidden'; ?>"> |
| 73 |
<label class="frm-h-stack-xs" for="<?php echo esc_attr( $this->get_field_id( 'bcc' ) ); ?>"> |
| 74 |
<span><?php esc_html_e( 'BCC', 'formidable' ); ?></span> |
| 75 |
<span <?php FrmAppHelper::maybe_add_tooltip( 'bcc' ); ?>><?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_icon frm_svg14' ); ?></span> |
| 76 |
</label> |
| 77 |
|
| 78 |
<input type="text" name="<?php echo esc_attr( $this->get_field_name( 'bcc' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['bcc'] ); ?>" class="frm_not_email_to large-text" id="<?php echo esc_attr( $this->get_field_id( 'bcc' ) ); ?>" /> |
| 79 |
<a href="javascript:void(0)" class="frm_remove_field" data-emailrow="bcc"><?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon frm_svg14' ); ?></a> |
| 80 |
</p> |
| 81 |
|
| 82 |
<p class="frm_reply_to_container frm-mb-0"> |
| 83 |
<a href="javascript:void(0)" class="button frm_email_buttons frm_reply_to_button <?php echo ( ! empty( $form_action->post_content['reply_to'] ) ? 'frm_hidden' : '' ); ?>" data-emailrow="reply_to"> |
| 84 |
<?php esc_html_e( 'Reply To', 'formidable' ); ?> |
| 85 |
</a> |
| 86 |
</p> |
| 87 |
|
| 88 |
<p class="frm_has_shortcodes frm_from_row frm_email_row frm-mb-md"> |
| 89 |
<label for="<?php echo esc_attr( $this->get_field_id( 'from' ) ); ?>"> |
| 90 |
<?php esc_html_e( 'From', 'formidable' ); ?> |
| 91 |
<span <?php FrmAppHelper::maybe_add_tooltip( 'from' ); ?>><?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_icon frm_svg14' ); ?></span> |
| 92 |
</label> |
| 93 |
|
| 94 |
<input type="text" name="<?php echo esc_attr( $this->get_field_name( 'from' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['from'] ); ?>" class="frm_not_email_to large-text" id="<?php echo esc_attr( $this->get_field_id( 'from' ) ); ?>" /> |
| 95 |
</p> |
| 96 |
|
| 97 |
<p class="frm_error_style frm_from_to_match_row frm-my-md <?php echo ( $form_action->post_content['from'] === $form_action->post_content['email_to'] ? '' : 'frm_hidden' ); ?>" data-emailrow="from_to_warning"> |
| 98 |
<?php esc_html_e( 'Warning: If you are sending an email to the user, the To and From fields should not match.', 'formidable' ); ?> |
| 99 |
</p> |
| 100 |
|
| 101 |
<p class="frm_has_shortcodes frm_reply_to_row frm_email_row frm-mb-md<?php echo ! empty( $form_action->post_content['reply_to'] ) ? '' : ' frm_hidden'; ?>"> |
| 102 |
<label for="<?php echo esc_attr( $this->get_field_id( 'reply_to' ) ); ?>"> |
| 103 |
<?php esc_html_e( 'Reply To', 'formidable' ); ?> |
| 104 |
<span <?php FrmAppHelper::maybe_add_tooltip( 'reply_to' ); ?>><?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_icon frm_svg14' ); ?></span> |
| 105 |
</label> |
| 106 |
|
| 107 |
<input type="text" name="<?php echo esc_attr( $this->get_field_name( 'reply_to' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['reply_to'] ); ?>" class="frm_not_email_to large-text" id="<?php echo esc_attr( $this->get_field_id( 'reply_to' ) ); ?>" /> |
| 108 |
<a href="javascript:void(0)" class="frm_remove_field" data-emailrow="reply_to"><?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon frm_svg14' ); ?></a> |
| 109 |
</p> |
| 110 |
|
| 111 |
<p class="frm_has_shortcodes frm_email_row frm-mb-md"> |
| 112 |
<label for="<?php echo esc_attr( $this->get_field_id( 'email_subject' ) ); ?>"> |
| 113 |
<?php esc_html_e( 'Subject', 'formidable' ); ?> |
| 114 |
<span <?php FrmAppHelper::maybe_add_tooltip( 'email_subject', '', $form->name ); ?>><?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_icon frm_svg14' ); ?></span> |
| 115 |
</label> |
| 116 |
<input type="text" name="<?php echo esc_attr( $this->get_field_name( 'email_subject' ) ); ?>" class="frm_not_email_subject large-text" id="<?php echo esc_attr( $this->get_field_id( 'email_subject' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['email_subject'] ); ?>" /> |
| 117 |
</p> |
| 118 |
|
| 119 |
<p class="frm_has_shortcodes frm-mb-md"> |
| 120 |
<label for="<?php echo esc_attr( $this->get_field_id( 'email_message' ) ); ?>"> |
| 121 |
<?php esc_html_e( 'Message', 'formidable' ); ?> |
| 122 |
</label> |
| 123 |
<?php |
| 124 |
$rich_text_emails = empty( $form_action->post_content['plain_text'] ); |
| 125 |
|
| 126 |
/** |
| 127 |
* @since 5.5.2 |
| 128 |
* |
| 129 |
* @param bool $rich_text_emails True by default unless plain text is selected. |
| 130 |
* @param array $args { |
| 131 |
* |
| 132 |
* @type stdClass $form |
| 133 |
* @type WP_Post $form_action |
| 134 |
* } |
| 135 |
*/ |
| 136 |
$rich_text_emails = apply_filters( 'frm_rich_text_emails', $rich_text_emails, compact( 'form', 'form_action' ) ); |
| 137 |
|
| 138 |
if ( $rich_text_emails ) { |
| 139 |
$editor_args = array( |
| 140 |
'textarea_name' => $this->get_field_name( 'email_message' ), |
| 141 |
'textarea_rows' => 6, |
| 142 |
'editor_class' => 'frm_not_email_message', |
| 143 |
); |
| 144 |
wp_editor( |
| 145 |
$form_action->post_content['email_message'], |
| 146 |
$this->get_field_id( 'email_message' ), |
| 147 |
$editor_args |
| 148 |
); |
| 149 |
} else { |
| 150 |
?> |
| 151 |
<textarea name="<?php echo esc_attr( $this->get_field_name( 'email_message' ) ); ?>" class="frm_not_email_message frm_long_input" id="<?php echo esc_attr( $this->get_field_id( 'email_message' ) ); ?>" cols="50" rows="5"><?php echo FrmAppHelper::esc_textarea( $form_action->post_content['email_message'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></textarea> |
| 152 |
<?php |
| 153 |
} |
| 154 |
?> |
| 155 |
</p> |
| 156 |
|
| 157 |
<label class="frm-h-stack-xs frm-my-md" for="<?php echo esc_attr( $this->get_field_id( 'inc_user_info' ) ); ?>"> |
| 158 |
<input type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'inc_user_info' ) ); ?>" class="frm_not_inc_user_info" id="<?php echo esc_attr( $this->get_field_id( 'inc_user_info' ) ); ?>" value="1" <?php checked( $form_action->post_content['inc_user_info'], 1 ); ?> /> |
| 159 |
<?php if ( FrmAppHelper::ips_saved() ) { ?> |
| 160 |
<?php esc_html_e( 'Append IP Address, Browser, and Referring URL to message', 'formidable' ); ?> |
| 161 |
<?php } else { ?> |
| 162 |
<?php esc_html_e( 'Append Browser and Referring URL to message', 'formidable' ); ?> |
| 163 |
<?php } ?> |
| 164 |
</label> |
| 165 |
|