PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.25.1
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.25.1
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / views / frm-form-actions / _email_settings.php

_email_settings.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.25.1, at classes/views/frm-form-actions/_email_settings.php

164 lines 8.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 if ( ! empty( $form_action->post_content['plain_text'] ) ) {
9 $selected_style = 'plain';
10 }
11
12 $frm_settings = FrmAppHelper::get_settings();
13 $default_style = FrmEmailStylesController::get_default_email_style();
14 ?>
15 <p class="frm-email-style-container">
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">
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">
56 <label for="<?php echo esc_attr( $this->get_field_id( 'email_to' ) ); ?>">
57 <?php esc_html_e( 'To', 'formidable' ); ?>
58 <span <?php FrmAppHelper::maybe_add_tooltip( 'email_to' ); ?>><?php FrmAppHelper::icon_by_class( 'frm_icon_font 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<?php echo empty( $form_action->post_content['cc'] ) ? ' frm_hidden' : ''; ?>">
64 <label for="<?php echo esc_attr( $this->get_field_id( 'cc' ) ); ?>">
65 <?php esc_html_e( 'CC', 'formidable' ); ?>
66 <span <?php FrmAppHelper::maybe_add_tooltip( 'cc' ); ?>><?php FrmAppHelper::icon_by_class( 'frm_icon_font 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( 'frm_icon_font frm_close_icon frm_svg14' ); ?></a>
70 </p>
71
72 <p class="frm_has_shortcodes frm_bcc_row frm_email_row<?php echo empty( $form_action->post_content['bcc'] ) ? ' frm_hidden' : ''; ?>">
73 <label for="<?php echo esc_attr( $this->get_field_id( 'bcc' ) ); ?>">
74 <?php esc_html_e( 'BCC', 'formidable' ); ?>
75 <span <?php FrmAppHelper::maybe_add_tooltip( 'bcc' ); ?>><?php FrmAppHelper::icon_by_class( 'frm_icon_font 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( 'frm_icon_font frm_close_icon frm_svg14' ); ?></a>
80 </p>
81
82 <p class="frm_reply_to_container">
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">
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( 'frm_icon_font 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 <?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<?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( 'frm_icon_font 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( 'frm_icon_font frm_close_icon frm_svg14' ); ?></a>
109 </p>
110
111 <p class="frm_has_shortcodes frm_email_row">
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( 'frm_icon_font 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">
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 * @type stdClass $form
132 * @type WP_Post $form_action
133 * }
134 */
135 $rich_text_emails = apply_filters( 'frm_rich_text_emails', $rich_text_emails, compact( 'form', 'form_action' ) );
136
137 if ( $rich_text_emails ) {
138 $editor_args = array(
139 'textarea_name' => $this->get_field_name( 'email_message' ),
140 'textarea_rows' => 6,
141 'editor_class' => 'frm_not_email_message',
142 );
143 wp_editor(
144 $form_action->post_content['email_message'],
145 $this->get_field_id( 'email_message' ),
146 $editor_args
147 );
148 } else {
149 ?>
150 <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>
151 <?php
152 }
153 ?>
154 </p>
155
156 <label for="<?php echo esc_attr( $this->get_field_id( 'inc_user_info' ) ); ?>">
157 <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 ); ?> />
158 <?php if ( FrmAppHelper::ips_saved() ) { ?>
159 <?php esc_html_e( 'Append IP Address, Browser, and Referring URL to message', 'formidable' ); ?>
160 <?php } else { ?>
161 <?php esc_html_e( 'Append Browser and Referring URL to message', 'formidable' ); ?>
162 <?php } ?>
163 </label>
164