Code Duplication    Length = 15-17 lines in 2 locations

code/TestMailerToFile.php 2 locations

@@ 22-36 (lines=15) @@
19
     */
20
    public function sendPlain($to, $from, $subject, $plainContent, $attachedFiles = false, $customheaders = false)
21
    {
22
        if ($this->Config()->get("show_all_details")) {
23
            $string = "
24
~TO: $to ~
25
~FROM: $from ~
26
~SUBJECT: $subject ~
27
~PLAINTEXT: $plainContent ~
28
~ATTACHEDFILES: ".print_r($attachedFiles, 1)." ~
29
~CUSTOMHEADERS: ".print_r($customheaders, 1)." ~";
30
        } else {
31
            $string = "
32
~PLAINTEXT: TRUE
33
~TO: $to ~
34
~FROM: $from ~
35
~SUBJECT: $subject ~";
36
        }
37
        $this->writeToFile($string);
38
        return true;
39
    }
@@ 46-62 (lines=17) @@
43
     */
44
    public function sendHTML($to, $from, $subject, $htmlContent, $attachedFiles = false, $customheaders = false, $plainContent = false, $inlineImages = false)
45
    {
46
        if ($this->Config()->get("show_all_details")) {
47
            $string = "
48
~TO: $to ~
49
~FROM: $from ~
50
~SUBJECT: $subject ~
51
~HTMLCONTENT: $htmlContent ~
52
~ATTACHEDFILES: ".print_r($attachedFiles, 1)." ~
53
~CUSTOMHEADERS: ".print_r($customheaders, 1)." ~
54
~PLAINTEXT: $plainContent ~
55
~INLINEIMAGES: $inlineImages ~";
56
        } else {
57
            $string = "
58
~PLAINTEXT: FALSE
59
~TO: $to ~
60
~FROM: $from ~
61
~SUBJECT: $subject ~";
62
        }
63
        $this->writeToFile($string);
64
        return true;
65
    }