| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Provide a admin area view for the plugin |
| 5 |
* |
| 6 |
* This file is used to markup the admin-facing aspects of the plugin. |
| 7 |
* |
| 8 |
* @link http://socketlabs.com |
| 9 |
* @since 1.0.0 |
| 10 |
* |
| 11 |
* @package Socketlabs |
| 12 |
* @subpackage Socketlabs/admin/partials |
| 13 |
*/ |
| 14 |
?> |
| 15 |
<div id="sl-plugin-container"> |
| 16 |
<div class="sl-masthead"> |
| 17 |
<div class="sl-masthead__inside-container"> |
| 18 |
<div class="sl-masthead__logo-container"> |
| 19 |
<img class="sl-masthead__logo" src="<?php echo plugins_url( 'socketlabs/admin/images/logo-wp.svg' ) ?>" alt="SocketLabs"> |
| 20 |
</div> |
| 21 |
</div> |
| 22 |
</div> |
| 23 |
<div class="sl-lower"> |
| 24 |
<?php echo_status(); ?> |
| 25 |
<?php echo_signup(); ?> |
| 26 |
<?php echo_api_key(); ?> |
| 27 |
</div> |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
<?php function echo_status(){ |
| 32 |
$api_status = Socketlabs::get_api_status(); |
| 33 |
if($api_status == Socketlabs_Api_Status::$SUCCESS){ |
| 34 |
?> |
| 35 |
<div class="sl-alert sl-active"> |
| 36 |
<h3 class="sl-key-status failed">Connection Successful</h3> |
| 37 |
<p class="sl-description">Wordpress is now configured to send any generated email through your SocketLabs server. </p> |
| 38 |
</div> |
| 39 |
<?php } |
| 40 |
else{ |
| 41 |
?> |
| 42 |
<div class="sl-alert sl-critical"> |
| 43 |
<h3 class="sl-key-status failed">Attention Required</h3> |
| 44 |
<p class="sl-description"><?php echo $api_status ?> </p> |
| 45 |
</div> |
| 46 |
<?php } |
| 47 |
} |
| 48 |
?> |
| 49 |
|
| 50 |
<?php function echo_signup(){ ?> |
| 51 |
<div class="sl-box"> |
| 52 |
<h2>Configure The SocketLabs WordPress Plugin For Optimized Email Delivery </h2> |
| 53 |
<p>The SocketLabs WordPress Plugin allows you to easily route email generated by WordPress through SocketLabs, rather than the default email delivery that WordPress provides. Follow the steps below to setup your plugin. </p> |
| 54 |
</div> |
| 55 |
<?php } ?> |
| 56 |
|
| 57 |
<?php function echo_api_key(){ |
| 58 |
$options = get_option( SOCKETLABS_OPTION_GROUP ); |
| 59 |
?> |
| 60 |
<div class="sl-boxes"> |
| 61 |
<div class="sl-box"> |
| 62 |
<h3>Step 1: Find Your Server ID and API Key</h3> |
| 63 |
<div class="sl-right"> |
| 64 |
<a class="sl-button sl-is-primary" target="_blank" href="https://www.socketlabs.com/blog/configure-wordpress-plugin/?utm_medium=wordpress&utm_campaign=wp-plugin&utm_source=wp-plugin#getkey">Get Your API Key</a> |
| 65 |
</div> |
| 66 |
<p>To start sending email using this Plugin, you'll need to enter your SocketLabs Server ID and API Key. Click on the button to the right to see how to get your Server ID & API Key.</p> |
| 67 |
</div> |
| 68 |
<div class="sl-box"> |
| 69 |
<h3>Step 2: Enter Your SocketLabs Server ID and API Key</h3> |
| 70 |
<p>Not sure where to find your Server ID and API Key? Find It Here: <a href="https://www.socketlabs.com/blog/configure-wordpress-plugin/?utm_medium=wordpress&utm_campaign=wp-plugin&utm_source=wp-plugin#getkey" target="_blank">(What is an API key?)</a></p> |
| 71 |
<form method="post" action="options.php"> |
| 72 |
<?php |
| 73 |
// This prints out all hidden setting fields |
| 74 |
settings_fields( SOCKETLABS_OPTION_GROUP ); |
| 75 |
?> |
| 76 |
|
| 77 |
<p style="width: 100%; display: flex; flex-wrap: nowrap; box-sizing: border-box;"> |
| 78 |
|
| 79 |
<input type='text' id='<?php echo SOCKETLABS_SERVER_ID; ?>' |
| 80 |
name='<?php echo SOCKETLABS_OPTION_GROUP; ?>[<?php echo SOCKETLABS_SERVER_ID; ?>]' |
| 81 |
value='<?php echo Socketlabs::get_server_id(); ?>' |
| 82 |
style="flex-grow: 2; margin-right: 1rem;" |
| 83 |
placeholder="Server Id" |
| 84 |
title="Server Id"/> |
| 85 |
|
| 86 |
<input type='text' id='<?php echo SOCKETLABS_API_KEY; ?>' |
| 87 |
name='<?php echo SOCKETLABS_OPTION_GROUP; ?>[<?php echo SOCKETLABS_API_KEY; ?>]' |
| 88 |
value='<?php echo Socketlabs::get_api_key(); ?>' |
| 89 |
style="flex-grow: 3; margin-right: 1rem;" |
| 90 |
placeholder = "SocketLabs Api Key" |
| 91 |
title="SocketLabs Api Key"/> |
| 92 |
|
| 93 |
<button |
| 94 |
type="submit" |
| 95 |
name="submit" |
| 96 |
id="submit" |
| 97 |
class="sl-button sl-is-primary" |
| 98 |
style="flex-grow: 1;">Ok</button> |
| 99 |
|
| 100 |
</p> |
| 101 |
</form> |
| 102 |
</div> |
| 103 |
<?php } ?> |
| 104 |
|