mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-16 16:43:42 +03:00

* Add the admin email field to the manage form * Fix admin email processing: When the email is changed, the pledge needs to be set back to pending, until the email is re-confirmed * Send confirmation emails for existing pledges to the "Manage Pledge" page * Process the email confirmation & resending emails actions on both shortcodes * Add a message for unconfirmed pledges
60 lines
1.8 KiB
PHP
60 lines
1.8 KiB
PHP
<?php
|
||
|
||
namespace WordPressDotOrg\FiveForTheFuture\View;
|
||
use WP_Post;
|
||
|
||
/**
|
||
* @var array $data
|
||
* @var bool $readonly
|
||
* @var WP_Post $pledge
|
||
*/
|
||
|
||
?>
|
||
|
||
<div class="form-field">
|
||
<label for="5ftf-pledge-email">
|
||
<?php esc_html_e( 'Administrator Email Address', 'wporg-5ftf' ); ?>
|
||
</label>
|
||
<input
|
||
type="email"
|
||
id="5ftf-pledge-email"
|
||
name="org-pledge-email"
|
||
placeholder="wordpress-contributors@example.com"
|
||
value="<?php echo esc_attr( $data['org-pledge-email'] ); ?>"
|
||
required
|
||
aria-describedby="5ftf-pledge-email-help"
|
||
<?php echo $readonly ? 'readonly' : ''; ?>
|
||
/>
|
||
<div id="5ftf-pledge-email-help">
|
||
<p>
|
||
<?php esc_html_e( 'This address will be used to confirm your organization’s contribution profile, and later manage any changes. Please make sure that it’s a group address (e.g., wp-contributors@example.com) so that it persists across employee transitions.', 'wporg-5ftf' ); ?>
|
||
</p>
|
||
<?php if ( ! empty( $data['org-pledge-email'] ) ) : ?>
|
||
<p>
|
||
<?php esc_html_e( 'If you change this email, you will need to confirm the new email. Your pledge will be unpublished until the new email is confirmed.', 'wporg-5ftf' ); ?>
|
||
</p>
|
||
<?php endif; ?>
|
||
</div>
|
||
|
||
<?php if ( is_admin() ) : ?>
|
||
<?php if ( $data['pledge-email-confirmed'] ) : ?>
|
||
<p class="email-status is-confirmed">
|
||
<span class="dashicons dashicons-yes-alt" aria-hidden="true"></span>
|
||
<?php esc_html_e( 'Confirmed', 'wporg-5ftf' ); ?>
|
||
</p>
|
||
<?php else : ?>
|
||
<p class="email-status is-unconfirmed">
|
||
<span class="dashicons dashicons-warning" aria-hidden="true"></span>
|
||
<?php esc_html_e( 'Unconfirmed', 'wporg-5ftf' ); ?>
|
||
</p>
|
||
<?php submit_button(
|
||
'Resend Confirmation',
|
||
'secondary',
|
||
'resend-pledge-confirmation',
|
||
false,
|
||
array( 'formaction' => add_query_arg( 'resend-pledge-id', $pledge->ID ) )
|
||
); ?>
|
||
<?php endif; ?>
|
||
<?php endif; ?>
|
||
</div>
|