Created
November 11, 2020 04:26
-
-
Save ronalfy/4817e656a4a52b3b3bca08cf0a17eb64 to your computer and use it in GitHub Desktop.
PMPro - Style the Email Confirmation Confirmation Message
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Sample HTML and example of wrapping a div around confirmation message for styling. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
/** | |
* Wrap a div around the confirmation message upon confirmation with email confirmation add-on. | |
*/ | |
/** | |
* Check to see if the confirmatiton message is active. | |
*/ | |
function my_pmpro_pmproec_pmpro_confirmation_message( $message ) { | |
if ( function_exists( 'pmproec_pmpro_confirmation_message' ) ) { | |
$message = sprintf( | |
'<div id="pmpro-email-confirmation-message">%s</div>', | |
$message | |
); | |
} | |
return $message; | |
} | |
add_filter("pmpro_confirmation_message", "my_pmpro_pmproec_pmpro_confirmation_message", 50 ); | |
/* Sample html | |
<div class="pmpro_confirmation_wrap"> | |
<div id="pmpro-email-confirmation-message"><p>Thank you for your membership to Paid Memberships Pro. Your Yearly membership will be activated as soon as you confirm your email address. <strong>Important! You must click on the confirmation URL sent to [email protected] before you gain full access to your membership</strong>.</p> | |
<p>This is a yearly recurring subscription. You may cancel at any time.</p> | |
<p>Below are details about your membership account and a receipt for your initial membership invoice. A welcome email with a copy of your initial membership invoice has been sent to [email protected].</p> | |
</div> <h3> | |
Invoice #1DBEA27C93 on November 11, 2020 </h3> | |
<a class="pmpro_a-print" href="javascript:window.print()">Print</a> | |
<ul> | |
<li><strong>Account:</strong> Kevin Daniels ([email protected])</li> | |
<li><strong>Membership Level:</strong> Yearly</li> | |
<li><strong>Membership Expires:</strong> November 11, 2021</li> | |
</ul> | |
<hr> | |
<div class="pmpro_invoice_details"> | |
<div class="pmpro_invoice-billing-address"> | |
<strong>Billing Address</strong> | |
<p>Kevin Daniels<br> | |
[object Object]<br> | |
Cartlerock, OK 89109 US<br> | |
(405) 555-9301 </p> | |
</div> <!-- end pmpro_invoice-billing-address --> | |
<div class="pmpro_invoice-payment-method"> | |
<strong>Payment Method</strong> | |
<p>Visa ending in 4242 <br> | |
Expiration: 01/2023</p> | |
</div> <!-- end pmpro_invoice-payment-method --> | |
<div class="pmpro_invoice-total"> | |
<strong>Total Billed</strong> | |
<p> $100.00 </p> | |
</div> <!-- end pmpro_invoice-total --> | |
</div> <!-- end pmpro_invoice --> | |
<hr> | |
<p class="pmpro_actions_nav"> | |
<a href="http://domain.com/membership-account/">View Your Membership Account →</a> | |
</p> <!-- end pmpro_actions_nav --> | |
</div> | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment