PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.2
JetFormBuilder — Dynamic Blocks Form Builder v3.1.2
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / includes / actions / send-email-hooks.php
jetformbuilder / includes / actions Last commit date
conditions 2 years ago events 2 years ago methods 2 years ago types 2 years ago action-handler.php 2 years ago action-localize.php 2 years ago actions-tools.php 2 years ago events-list.php 2 years ago events-manager.php 2 years ago legacy-request-data.php 2 years ago manager.php 2 years ago send-email-hooks.php 2 years ago
send-email-hooks.php
74 lines
1 <?php
2
3
4 namespace Jet_Form_Builder\Actions;
5
6 use Jet_Form_Builder\Actions\Types\Send_Email;
7 use Jet_Form_Builder\Classes\Http\Http_Tools;
8
9 class Send_Email_Hooks {
10
11 public static function register() {
12 add_action(
13 'jet-form-builder/send-email/send-before',
14 array( self::class, 'basic_formatting' )
15 );
16 add_action(
17 'jet-form-builder/send-email/send-before',
18 array( self::class, 'basic_content_formatting' )
19 );
20 add_action(
21 'jet-form-builder/send-email/send-before',
22 array( self::class, 'content_unslash' )
23 );
24 }
25
26 public static function basic_formatting( Send_Email $email ) {
27 $email->set_content(
28 jet_fb_parse_macro( $email->get_content() )
29 );
30 $email->set_content(
31 do_shortcode( $email->get_content() )
32 );
33 $email->set_subject(
34 jet_fb_parse_macro( $email->get_subject() )
35 );
36 $email->set_from_name(
37 jet_fb_parse_macro( $email->get_from_name() )
38 );
39 $email->set_from_address(
40 jet_fb_parse_macro( $email->get_from_address() )
41 );
42 $email->set_reply_to(
43 jet_fb_parse_macro( $email->get_reply_to() )
44 );
45
46 if ( ! is_email( $email->get_reply_to() ) ) {
47 $email->set_reply_to( 'noreply@' . Http_Tools::get_site_host() );
48 }
49
50 if ( ! is_email( $email->get_from_address() ) ) {
51 $email->set_from_address( get_option( 'admin_email' ) );
52 }
53
54 $email->update_headers();
55 }
56
57 public static function basic_content_formatting( Send_Email $email ) {
58 $message = $email->get_content();
59
60 if ( $email->is_html() && empty( $email->settings['disable_format'] ) ) {
61 $message = make_clickable( wpautop( $message ) );
62 }
63
64 $email->set_content(
65 str_replace( '&#038;', '&amp;', $message )
66 );
67 }
68
69 public static function content_unslash( Send_Email $email ) {
70 $email->set_content( wp_unslash( $email->get_content() ) );
71 }
72
73 }
74