| Conditions | 3 |
| Paths | 3 |
| Total Lines | 29 |
| Code Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | public function sendHTML( |
||
| 9 | $to, |
||
| 10 | $from, |
||
| 11 | $subject, |
||
| 12 | $htmlContent, |
||
| 13 | $attachedFiles = false, |
||
| 14 | $customheaders = false, |
||
| 15 | $plainContent = false |
||
| 16 | ) { |
||
| 17 | $cssFileLocation = Director::baseFolder() . Config::inst()->get("EmailReminder_Mailer", "css_file"); |
||
| 18 | if ($cssFileLocation) { |
||
| 19 | if (file_exists($cssFileLocation)) { |
||
| 20 | $cssFileHandler = fopen($cssFileLocation, 'r'); |
||
| 21 | $css = fread($cssFileHandler, filesize($cssFileLocation)); |
||
| 22 | fclose($cssFileHandler); |
||
| 23 | $emog = new \Pelago\Emogrifier($htmlContent, $css); |
||
| 24 | $htmlContent = $emog->emogrify(); |
||
| 25 | } |
||
| 26 | } |
||
| 27 | return parent::sendHTML( |
||
| 28 | $to, |
||
| 29 | $from, |
||
| 30 | $subject, |
||
| 31 | $htmlContent, |
||
| 32 | $attachedFiles, |
||
| 33 | $customheaders, |
||
| 34 | $plainContent |
||
| 35 | ); |
||
| 36 | } |
||
| 37 | } |
||
| 38 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.