Source Code Documentation


s2member-pro\includes\menu-pages\paypal-ops-signup-email.inc.php


  1. <?php
  2. /**
  3. * Menu page for s2Member Pro ( PayPal® options, Signup Email ).
  4. *
  5. * Copyright: © 2009-2011
  6. * {@link http://www.websharks-inc.com/ WebSharks, Inc.}
  7. * ( coded in the USA )
  8. *
  9. * This WordPress® plugin ( s2Member Pro ) is comprised of two parts:
  10. *
  11. * o (1) Its PHP code is licensed under the GPL license, as is WordPress®.
  12. * You should have received a copy of the GNU General Public License,
  13. * along with this software. In the main directory, see: /licensing/
  14. * If not, see: {@link http://www.gnu.org/licenses/}.
  15. *
  16. * o (2) All other parts of ( s2Member Pro ); including, but not limited to:
  17. * the CSS code, some JavaScript code, images, and design;
  18. * are licensed according to the license purchased.
  19. * See: {@link http://www.s2member.com/prices/}
  20. *
  21. * Unless you have our prior written consent, you must NOT directly or indirectly license,
  22. * sub-license, sell, resell, or provide for free; part (2) of the s2Member Pro Module;
  23. * or make an offer to do any of these things. All of these things are strictly
  24. * prohibited with part (2) of the s2Member Pro Module.
  25. *
  26. * Your purchase of s2Member Pro includes free lifetime upgrades via s2Member.com
  27. * ( i.e. new features, bug fixes, updates, improvements ); along with full access
  28. * to our video tutorial library: {@link http://www.s2member.com/videos/}
  29. *
  30. * @package s2Member\Menu_Pages
  31. * @since 1.5
  32. */
  33. if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
  34. exit("Do not access this file directly.");
  35. /**/
  36. if (!class_exists ("c_ws_plugin__s2member_pro_menu_page_paypal_ops_signup_email"))
  37. {
  38. /**
  39. * Menu page for s2Member Pro ( PayPal® options, Signup Email ).
  40. *
  41. * @package s2Member\Menu_Pages
  42. * @since 110531
  43. */
  44. class c_ws_plugin__s2member_pro_menu_page_paypal_ops_signup_email
  45. {
  46. public function __construct ()
  47. {
  48. echo '<div class="ws-menu-page-group" title="Signup Confirmation Email ( Pro Form )">' . "\n";
  49. /**/
  50. echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-signup-confirmation-email-section">' . "\n";
  51. echo '<h3>Signup Confirmation Email ( required, but the default works fine )<br />— specifically for s2Member Pro Form integrations</h3>' . "\n";
  52. echo '<p>This email is sent to new Customers after they successfully complete a PayPal® "Pro Form" submission on your site. The <strong>primary</strong> purpose of this email, is to provide the Customer with a receipt, and NOT to send them a <code>%%registration_url%%</code>, because PayPal® Pro Form integration handles that automatically; based on scenario. You may want to customize this email further, by providing details that are specifically geared to your site.</p>' . "\n";
  53. /**/
  54. echo '<table class="form-table">' . "\n";
  55. echo '<tbody>' . "\n";
  56. echo '<tr>' . "\n";
  57. /**/
  58. echo '<th>' . "\n";
  59. echo '<label for="ws-plugin--s2member-pro-signup-email-recipients">' . "\n";
  60. echo 'Signup Confirmation Recipients:' . "\n";
  61. echo '</label>' . "\n";
  62. echo '</th>' . "\n";
  63. /**/
  64. echo '</tr>' . "\n";
  65. echo '<tr>' . "\n";
  66. /**/
  67. echo '<td>' . "\n";
  68. echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_pro_signup_email_recipients" id="ws-plugin--s2member-pro-signup-email-recipients" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_signup_email_recipients"]) . '" /><br />' . "\n";
  69. echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
  70. echo '<code>"%%full_name%%" &lt;%%payer_email%%&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
  71. echo '</td>' . "\n";
  72. /**/
  73. echo '</tr>' . "\n";
  74. echo '<tr>' . "\n";
  75. /**/
  76. echo '<th>' . "\n";
  77. echo '<label for="ws-plugin--s2member-pro-signup-email-subject">' . "\n";
  78. echo 'Signup Confirmation Email Subject:' . "\n";
  79. echo '</label>' . "\n";
  80. echo '</th>' . "\n";
  81. /**/
  82. echo '</tr>' . "\n";
  83. echo '<tr>' . "\n";
  84. /**/
  85. echo '<td>' . "\n";
  86. echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_pro_signup_email_subject" id="ws-plugin--s2member-pro-signup-email-subject" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_signup_email_subject"]) . '" /><br />' . "\n";
  87. echo 'Subject Line used in the email sent to a Customer after a successful signup has occurred through a PayPal® Pro Form.' . "\n";
  88. echo '</td>' . "\n";
  89. /**/
  90. echo '</tr>' . "\n";
  91. echo '<tr>' . "\n";
  92. /**/
  93. echo '<th>' . "\n";
  94. echo '<label for="ws-plugin--s2member-pro-signup-email-message">' . "\n";
  95. echo 'Signup Confirmation Email Message:' . "\n";
  96. echo '</label>' . "\n";
  97. echo '</th>' . "\n";
  98. /**/
  99. echo '</tr>' . "\n";
  100. echo '<tr>' . "\n";
  101. /**/
  102. echo '<td>' . "\n";
  103. echo '<textarea name="ws_plugin__s2member_pro_signup_email_message" id="ws-plugin--s2member-pro-signup-email-message" rows="10">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_signup_email_message"]) . '</textarea><br />' . "\n";
  104. echo 'Message Body used in the email sent to a Customer after a successful signup has occurred through a PayPal® Pro Form.<br /><br />' . "\n";
  105. echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
  106. echo '<ul>' . "\n";
  107. echo '<li><code>%%registration_url%%</code> = Not needed with PayPal® Pro Form integration. Pro Forms handle this automatically.</li>' . "\n";
  108. echo '<li><code>%%subscr_id%%</code> = The PayPal® Subscription ID, which remains constant throughout any &amp; all future payments. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term ( non-recurring ) access, using Buy Now functionality; the %%subscr_id%% is actually set to the Transaction ID for the purchase. PayPal® does not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring ( i.e. there is only ONE payment ), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
  109. echo '<li><code>%%initial%%</code> = The Initial Fee charged during signup. If you offered a 100% Free Trial, this will be <code>0</code>. [ <a href="#" onclick="alert(\'This will always represent the amount of money the Customer spent, whenever they initially signed up, no matter what. If a Customer signs up, under the terms of a 100% Free Trial Period, this will be 0.\'); return false;">?</a> ]</li>' . "\n";
  110. echo '<li><code>%%regular%%</code> = The Regular Amount of the Subscription. This value is <code>always > 0</code>, no matter what. [ <a href="#" onclick="alert(\'This is how much the Subscription costs after an Initial Period expires. The %%regular%% rate is always > 0. If you did NOT offer an Initial Period at a different price, %%initial%% and %%regular%% will be equal to the same thing.\'); return false;">?</a> ]</li>' . "\n";
  111. echo '<li><code>%%recurring%%</code> = This is the amount that will be charged on a recurring basis, or <code>0</code> if non-recurring. [ <a href="#" onclick="alert(\'If Recurring Payments have not been required, this will be equal to 0. That being said, %%regular%% &amp; %%recurring%% are usually the same value. This variable can be used in two different ways. You can use it to determine what the Regular Recurring Rate is, or to determine whether the Subscription will recur or not. If it is going to recur, %%recurring%% will be > 0.\'); return false;">?</a> ]</li>' . "\n";
  112. echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
  113. echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
  114. echo '<li><code>%%full_name%%</code> = The Full Name ( First &amp; Last ) of the Customer who purchased the Membership Subscription.</li>' . "\n";
  115. echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription.</li>' . "\n";
  116. echo '<li><code>%%user_ip%%</code> = The Customer\'s IP Address, detected during checkout via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
  117. echo '<li><code>%%item_number%%</code> = The Item Number ( colon separated <code><em>level:custom_capabilities:fixed term</em></code> ) that the Subscription is for.</li>' . "\n";
  118. echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n";
  119. echo '<li><code>%%initial_term%%</code> = This is the term length of the Initial Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%initial_term%% = 1 D ( this means 1 Day )\\n%%initial_term%% = 1 W ( this means 1 Week )\\n%%initial_term%% = 1 M ( this means 1 Month )\\n%%initial_term%% = 1 Y ( this means 1 Year )\\n\\nThe Initial Period never recurs, so this only lasts for the term length specified, then it is over.\'); return false;">?</a> ]</li>' . "\n";
  120. echo '<li><code>%%initial_cycle%%</code> = This is the <code>%%initial_term%%</code> from above, converted to a cycle representation of: <code><em>X days/weeks/months/years</em></code>.</li>' . "\n";
  121. echo '<li><code>%%regular_term%%</code> = This is the term length of the Regular Period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%regular_term%% = 1 D ( this means 1 Day )\\n%%regular_term%% = 1 W ( this means 1 Week )\\n%%regular_term%% = 1 M ( this means 1 Month )\\n%%regular_term%% = 1 Y ( this means 1 Year )\\n%%regular_term%% = 1 L ( this means 1 Lifetime )\\n\\nThe Regular Term is usually recurring. So the Regular Term value represents the period ( or duration ) of each recurring period. If %%recurring%% = 0, then the Regular Term only applies once, because it is not recurring. So if it is not recurring, the value of %%regular_term%% simply represents how long their Membership privileges are going to last after the %%initial_term%% has expired, if there was an Initial Term. The value of this variable ( %%regular_term%% ) will never be empty, it will always be at least: 1 D, meaning 1 day. No exceptions.\'); return false;">?</a> ]</li>' . "\n";
  122. echo '<li><code>%%regular_cycle%%</code> = This is the <code>%%regular_term%%</code> from above, converted to a cycle representation of: <code><em>[every] X days/weeks/months/years — OR daily, weekly, bi-weekly, monthly, bi-monthly, quarterly, yearly, or lifetime</em></code>. This is a very useful Replacment Code. Its value is dynamic; depending on term length, recurring status, and period/term lengths configured.</li>' . "\n";
  123. echo '<li><code>%%recurring/regular_cycle%%</code> = Example ( <code>14.95 / Monthly</code> ), or ... ( <code>0 / non-recurring</code> ); depending on the value of <code>%%recurring%%</code>.</li>' . "\n";
  124. echo '</ul>' . "\n";
  125. /**/
  126. echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
  127. echo '<ul>' . "\n";
  128. echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
  129. echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
  130. echo '</ul>' . "\n";
  131. echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
  132. echo '<em>( The campaign ( i.e. christmas-promo ) could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
  133. echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
  134. /**/
  135. echo '</td>' . "\n";
  136. /**/
  137. echo '</tr>' . "\n";
  138. echo '</tbody>' . "\n";
  139. echo '</table>' . "\n";
  140. echo '</div>' . "\n";
  141. /**/
  142. echo '</div>' . "\n";
  143. }
  144. }
  145. }
  146. /**/
  147. new c_ws_plugin__s2member_pro_menu_page_paypal_ops_signup_email ();
  148. ?>

s2member-pro\includes\menu-pages\paypal-ops-signup-email.inc.php

Source Code Documentation