# fluent-support/1.5.1/app/Services/Mailer.php

Fluent Support – Helpdesk &amp; Customer Support Ticket System, version 1.5.1. 37 lines.

- Page: https://pluginprobe.com/plugins/fluent-support/1.5.1/code/app/Services/Mailer.php
- Raw: https://pluginprobe.com/plugins/fluent-support/1.5.1/raw/app/Services/Mailer.php
- Modified: 2021-11-12T14:57:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-support/1.5.1/code/app/Services/Mailer.php#L10-L20`.

```php
<?php

namespace FluentSupport\App\Services;

use FluentSupport\App\App;
use FluentSupport\Framework\Support\Arr;

class Mailer
{
    public static function send($to, $subject, $body, $extraHeader = [])
    {
        $headers = self::getHeaders();

        if($extraHeader) {
            foreach ($extraHeader as $header) {
                $headers[] = $header;
            }
        }

        return wp_mail($to, $subject, $body, $headers);
    }

    public static function getHeaders()
    {
        $headers[] = 'Content-Type: text/html; charset=UTF-8';
        return $headers;
    }

    public static function getWithTemplate($body)
    {
        $app  = App::getInstance();
        return $app->view->make('emails.classic_template', [
            'email_body' => $body
        ]);
    }
}

```
