# double-opt-in/2.13/templates/view-optin.php

Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification, version 2.13. 172 lines.

- Page: https://pluginprobe.com/plugins/double-opt-in/2.13/code/templates/view-optin.php
- Raw: https://pluginprobe.com/plugins/double-opt-in/2.13/raw/templates/view-optin.php
- Modified: 2022-12-16T11:04:54+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/double-opt-in/2.13/code/templates/view-optin.php#L10-L20`.

```php
<?php
/**
 * @var \forge12\contactform7\CF7DoubleOptIn\OptIn $optin
 * @var string                                     $domain
 */
$formfields = maybe_unserialize($optin->get_content());;
$Category = \forge12\contactform7\CF7DoubleOptIn\Category::get_by_id($optin->get_category());
$category_html = '---';

if (null != $Category) {
    $category_html = '<a href="' . esc_url($Category->get_link_ui()) . '">' . esc_attr($Category->get_name()) . '</a>';
}
?>
<script>hljs.highlightAll();</script>
<p>
    <?php _e('Category', 'double-opt-in') ?>: <?php echo wp_kses($category_html, array('a' => array('href' => array()))); ?>
</p>
<?php if (current_user_can('manage_options')): ?>
    <div class="options">
        <a href="<?php echo esc_url(admin_url('admin.php?page=f12-cf7-doubleoptin&option=delete&hash=' . $optin->get_hash())); ?>"
           class="button"
        ><?php _e('Delete DOI', 'double-opt-in'); ?></a>
    </div>
<?php endif; ?>
<table class="view-optin">
    <tr>
        <td><?php _e('Key', 'double-opt-in'); ?></td>
        <td><?php _e('Value', 'double-opt-in'); ?></td>
    </tr>
    <tr>
        <td>
            <?php _e('ID', 'double-opt-in'); ?>
        </td>
        <td>
            <?php echo esc_html($optin->get_id()); ?>
        </td>
    </tr>
    <tr>
        <td>
            <?php _e('CF7 Form ID', 'double-opt-in'); ?>
        </td>
        <td>
            <?php echo esc_html($optin->get_cf_form_id()); ?>
        </td>
    </tr>
    <tr>
        <td>
            <?php _e('E-Mail', 'double-opt-in'); ?>
        </td>
        <td>
            <?php echo esc_html($optin->get_email()); ?>
        </td>
    </tr>
    <tr>
        <td>
            <?php _e('Registration Date', 'double-opt-in'); ?>
        </td>
        <td>
            <?php
            echo esc_html($optin->get_createtime('formatted'));
            ?>
        </td>
    </tr>
    <tr>
        <td>
            <?php _e('Registration IP', 'double-opt-in'); ?>
        </td>
        <td>
            <?php echo esc_html($optin->get_ipaddr_register()); ?>
        </td>
    </tr>
    <tr>
        <td>
            <?php _e('Confirmation Date', 'double-opt-in'); ?>
        </td>
        <td>
            <?php
            if ($optin->is_confirmed()) {
                echo esc_html($optin->get_updatetime('formatted'));
            }
            ?>
        </td>
    </tr>
    <tr>
        <td>
            <?php _e('Confirmation IP', 'double-opt-in'); ?>
        </td>
        <td>
            <?php
            echo esc_html($optin->get_ipaddr_confirmation());
            ?>
        </td>
    </tr>
</table>

<h3><?php _e('Form Fields', 'double-opt-in'); ?></h3>
<table class="view-optin">
    <tr>
        <td><?php _e('Key', 'double-opt-in'); ?></td>
        <td><?php _e('Value', 'double-opt-in'); ?></td>
    </tr>
    <?php if (isset($formfields['fields'])): ?>
        <?php foreach ($formfields['fields'] as $key => $value): ?>
            <tr>
                <td>
                    <?php echo esc_attr($key); ?>
                </td>
                <td>
                    <?php if (is_array($value)) {
                        echo esc_html(implode(',', $value));
                    } else {
                        echo esc_html($value);
                    }
                    ?>
                </td>
            </tr>
        <?php endforeach; ?>
    <?php else: ?>
        <?php foreach ($formfields as $key => $value): ?>
            <tr>
                <td>
                    <?php echo $key; ?>
                </td>
                <td>
                    <?php if (is_array($value)) {
                        echo esc_html(implode(',', $value));
                    } else {
                        echo esc_html($value);
                    }
                    ?>
                </td>
            </tr>
        <?php endforeach; ?>
    <?php endif; ?>
</table>

</div>
<div class="box">
    <h2><?php _e('Formular', 'double-opt-in'); ?></h2>
    <p>
        <?php _e('The data above was collected by the following form used from the visitor. The data has been saved as plain text. You can copy the plain content to a html file to see the original formular.', 'double-opt-in');?>
    </p>
    <div class="option">
        <div class="label">
            <label for="category"><?php _e('HTML:', 'double-opt-in'); ?></label>
        </div>
        <div class="input">
            <pre>
                <code class="language-html">
                    <?php echo esc_html($optin->get_form()); ?>
                </code>
            </pre>
        </div>
    </div>
</div>
<div class="box">
    <h2><?php _e('Opt-In Mail', 'double-opt-in'); ?></h2>
    <p>
        <?php _e('The following Opt-In mail has been submitted to the visitor to get the confirmation. The data has been saved as plain text. Depending on the form it may contain html content.', 'double-opt-in');?>
    </p>
    <div class="option">
        <div class="label">
            <label for="category"><?php _e('HTML:', 'double-opt-in'); ?></label>
        </div>
        <div class="input">
            <pre>
                <code class="language-html">
                    <?php echo esc_html(str_replace('<br />', '\n',$optin->get_mail_optin())); ?>
                </code>
            </pre>
        </div>
    </div>
```
