/var/www/html_fr/wp-content/plugins/fluent-smtp/app/Services/Mailer/FluentPHPMailer.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php

namespace FluentMail\App\Services\Mailer;

use 
FluentMail\App\Models\Logger;
use 
FluentMail\App\Services\Mailer\Providers\Factory;
use 
FluentMail\App\Services\Mailer\Providers\DefaultMail\Handler as PHPMailer;

class 
FluentPHPMailer
{
    protected 
$app null;

    protected 
$phpMailer null;

    public function 
__construct($phpMailer)
    {
        
$this->app fluentMail();

        
$this->phpMailer $phpMailer;
    }

    public function 
send()
    {
        if (
$driver fluentMailGetProvider($this->phpMailer->From)) {
            if (
$forceFromEmail $driver->getSetting('force_from_email_id')) {
                
$this->phpMailer->From $forceFromEmail;
            }
            return 
$driver->setPhpMailer($this->phpMailer)->send();
        }

        return 
$this->phpMailer->send();
    }

    public function 
sendViaFallback($rowId)
    {
        
$driver fluentMailGetProvider($this->phpMailer->From);
        if(
$driver) {
            
$driver->setRowId($rowId);
            return 
$driver->setPhpMailer($this->phpMailer)->send();
        }
        return 
false;
    }

    public function 
__get($key)
    {
        return 
$this->phpMailer->{$key};
    }

    public function 
__set($key$value)
    {
        
$this->phpMailer->{$key} = $value;
    }

    public function 
__call($method$params)
    {
        return 
call_user_func_array([$this->phpMailer$method], $params);
    }
}