Email: Send pledge confirmation with authentication token.

Fixes #34.
Fixes #10.
This commit is contained in:
Ian Dunn 2019-10-23 11:16:02 -07:00
parent 6fe5a92c7b
commit 147da5ae24
No known key found for this signature in database
GPG key ID: 99B971B50343CBCB
7 changed files with 476 additions and 6 deletions

View file

@ -0,0 +1,42 @@
<?php
namespace WordPressDotOrg\FiveForTheFuture\View;
/**
* @var bool $email_confirmed
* @var string $directory_url
*/
?>
<?php if ( true === $email_confirmed ) : ?>
<div class="notice notice-success notice-alt">
<p>
Thank you for confirming your address! Your pledge will show up in <a href="<?php echo esc_url( $directory_url ); ?>">the directory</a> once one of your contributors confirms their participation.
</p>
</div>
<?php else : ?>
<div class="notice notice-error notice-alt">
<p>
<?php
/*
* There could be other reasons it failed, like an invalid token, but this is the most common reason,
* and the only one that normal users should experience, so we're assuming it in order to provide
* the best UX.
*/
?>
Your confirmation link has expired, please obtain a new one:
</p>
<p>
<button class="button-secondary">
<?php esc_html_e( 'Resend confirmation email', 'wporg' ); ?>
<?php // todo make ^ work when making the other 2 work ?>
</button>
</p>
</div>
<?php endif; ?>