# give/4.15.5/src/FormBuilder/EmailPreview/Controllers/ShowEmailPreview.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.15.5. 22 lines.

- Page: https://pluginprobe.com/plugins/give/4.15.5/code/src/FormBuilder/EmailPreview/Controllers/ShowEmailPreview.php
- Raw: https://pluginprobe.com/plugins/give/4.15.5/raw/src/FormBuilder/EmailPreview/Controllers/ShowEmailPreview.php
- Modified: 2023-10-16T17:55:46+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/give/4.15.5/code/src/FormBuilder/EmailPreview/Controllers/ShowEmailPreview.php#L10-L20`.

```php
<?php

namespace Give\FormBuilder\EmailPreview\Controllers;

use Give\FormBuilder\EmailPreview\Actions\BuildEmailPreview;

class ShowEmailPreview
{
    public function __invoke(\WP_REST_Request $request)
    {
        Give()->emails->__set(
            'html',
            true
        ); // Show formatted text in browser even text/plain content type set for an email.

        ob_clean();
        header('Content-Type: text/html; charset=UTF-8');
        echo give(BuildEmailPreview::class)->__invoke($request);
        exit;
    }
}

```
