PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.6.21
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.6.21
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / includes / templates / class-template-export-data-request.php

class-template-export-data-request.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.6.21, at includes/templates/class-template-export-data-request.php

95 lines 3.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Contact form template
5 */
6 class WeForms_Template_Export_Data_Request extends WeForms_Form_Template {
7
8 public function __construct() {
9 parent::__construct();
10
11 $this->enabled = true;
12 $this->title = __( 'Export Data Request Form', 'weforms' );
13 $this->description = __( "Includes action to add users to WordPress' personal data export tool, allowing admins to comply with the GDPR and other privacy regulations from the site's front end.", 'weforms' );
14 $this->image = WEFORMS_ASSET_URI . '/images/form-template/data-export-form.png';
15 $this->category = 'default';
16 }
17
18 /**
19 * Get the form fields
20 *
21 * @return array
22 */
23 public function get_form_fields() {
24 $all_fields = $this->get_available_fields();
25
26 $form_fields = [
27 array_merge( $all_fields['custom_html']->get_field_props(), [
28 'name' => 'custom_html',
29 'html' => '<h3>Personal Data Export Request:</h3>
30 <p>If you have an account on this site or have left comments you can request to export any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.</p>
31
32 <p>Please use this form to request personal data export.</p>',
33 ] ),
34
35 array_merge( $all_fields['email_address']->get_field_props(), [
36 'required' => 'yes',
37 'label' => 'Your email address (required)',
38 'name' => 'user_email_address',
39 ] ),
40 ];
41
42 return $form_fields;
43 }
44
45 /**
46 * Get the form settings
47 *
48 * @return array
49 */
50 public function get_form_settings() {
51 $defaults = $this->get_default_settings();
52
53 return array_merge( $defaults, [
54 'message' => __( 'Your inquiry has been submitted. Please check your email to validate your data request.', 'weforms' ),
55 'submit_text' => __( 'Send request', 'weforms' ),
56 ] );
57 }
58
59 /**
60 * Get the form notifications
61 *
62 * @return array
63 */
64 public function get_form_notifications() {
65 $defaults = $this->get_default_notification();
66
67 $message_body = 'Hello, <br><br>';
68 $message_body .= 'A request has been made to export personal data of your account.<br><br>';
69 $message_body .= 'To confirm this, please click on the following link: <br>';
70 $message_body .= '{personal_data_export_confirm_url} <br><br>';
71 $message_body .= 'You can safely ignore and delete this email if you do not want to take this action. <br><br>';
72 $message_body .= 'This email has been sent to {field:user_email_address} <br><br>';
73 $message_body .= 'Regards, <br>';
74 $message_body .= '{site_name} <br>';
75 $message_body .= '{site_url}';
76
77 $form_notifications = [
78 array_merge( $defaults[0], [
79 'active' => 'true',
80 'name' => 'User Notification',
81 'subject' => '[{form_name}] Confirm Action: Export Personal Data',
82 'to' => '{field:user_email_address}',
83 'replyTo' => '{admin_email}',
84 'message' => $message_body,
85 'fromName' => '{site_name}',
86 'fromAddress' => '{admin_email}',
87 'cc' => '',
88 'bcc' => '',
89 ] ),
90 ];
91
92 return $form_notifications;
93 }
94 }
95