PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.15.3
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.15.3
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
← All changes | includes/Core/Util/MailConfig.php +10 -21 3.2.22.15.3 View file →
@@ -1,12 +1,8 @@
1 1 <?php
2 2
3 3 namespace BitCode\BitForm\Core\Util;
4 4
5 -if (!defined('ABSPATH')) {
6 - exit;
7 -}
8 -
9 5 use BitCode\BitForm\Core\Integration\IntegrationHandler;
10 6
11 7 /**
12 8 * Class handling plugin activation.
@@ -27,30 +23,23 @@
27 23 {
28 24 $integrationHandler = new IntegrationHandler(0);
29 25 $formIntegrations = $integrationHandler->getAllIntegration('mail', 'smtp', 1);
30 26 if (!isset($formIntegrations->errors['result_empty'])) {
31 - $integrationRow = Utilities::firstRow($formIntegrations);
32 - if ($integrationRow && 1 === (int) $integrationRow->status) {
33 - $integration_details = Utilities::jsonObj($integrationRow->integration_details ?? '');
27 + if (1 === (int) $formIntegrations[0]->status) {
28 + $integration_details = json_decode($formIntegrations[0]->integration_details);
34 29 $phpmailer->Mailer = 'smtp';
35 - $phpmailer->Host = $integration_details->smtp_host ?? '';
30 + $phpmailer->Host = $integration_details->smtp_host;
36 31 $phpmailer->SMTPAuth = true;
37 32 if (!empty($integration_details->re_email_address)) {
38 33 $phpmailer->addReplyTo($integration_details->re_email_address, 'reply-to');
39 34 }
40 - $phpmailer->Port = $integration_details->port ?? '';
41 - $phpmailer->Username = $integration_details->smtp_user_name ?? '';
42 - $phpmailer->Password = $integration_details->smtp_password ?? '';
43 - $phpmailer->SMTPSecure = $integration_details->encryption ?? '';
44 - // $phpmailer->SMTPDebug = 1;
45 - // $phpmailer->Debugoutput = 'error_log';
46 - $phpmailer->From = $integration_details->form_email_address ?? '';
47 - $phpmailer->Sender = $integration_details->form_email_address ?? '';
48 - if (isset($this->config['from_email']) && !empty($this->config['from_email'])) {
49 - $phpmailer->From = $this->config['from_email'];
50 - $phpmailer->Sender = $this->config['from_email'];
51 - }
52 - $from_name = $integration_details->form_name ?? '';
35 + $phpmailer->Port = $integration_details->port;
36 + $phpmailer->Username = $integration_details->smtp_user_name;
37 + $phpmailer->Password = $integration_details->smtp_password;
38 + $phpmailer->SMTPSecure = $integration_details->encryption;
39 + $phpmailer->SMTP_DEBUG = 1;
40 + $phpmailer->From = $integration_details->form_email_address;
41 + $from_name = $integration_details->form_name;
53 42 if (isset($this->config['from_name']) && !empty($this->config['from_name'])) {
54 43 $from_name = $this->config['from_name'];
55 44 }
56 45 $phpmailer->FromName = $from_name;