<?php
/**
 * Customer Welcome Email
 *
 * This template can be overridden by copying it to yourtheme/stripe-sub-manager/emails/customer-welcome.php.
 *
 * @package Stripe_Sub_Manager/Templates/Emails
 * @version 1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

$user_name = isset( $user_name ) ? $user_name : '';
$site_name = isset( $site_name ) ? $site_name : get_bloginfo( 'name' );
$reset_url = isset( $reset_url ) ? $reset_url : '';

?>
<p><?php
    /* translators: %s: customer first name or display name */
    printf( esc_html__( 'Hello %s,', 'subscription-manager-for-stripe' ), esc_html( $user_name ) );
?></p>

<p><?php
    /* translators: %s: site name */
    printf( esc_html__( 'Welcome to %s! Your account has been created and your subscription is active.', 'subscription-manager-for-stripe' ), esc_html( $site_name ) );
?></p>

<p><?php esc_html_e( 'To access your account, please set your password by clicking the link below:', 'subscription-manager-for-stripe' ); ?></p>

<p>
    <a href="<?php echo esc_url( $reset_url ); ?>" style="display:inline-block;padding:10px 20px;background-color:#0073aa;color:#ffffff;text-decoration:none;border-radius:4px;">
        <?php esc_html_e( 'Set Your Password', 'subscription-manager-for-stripe' ); ?>
    </a>
</p>

<p><?php
    $expiration_seconds = apply_filters( 'password_reset_expiration', DAY_IN_SECONDS );
    $expiration_hours   = ceil( $expiration_seconds / HOUR_IN_SECONDS );
    printf(
        /* translators: %d: number of hours until the password reset link expires */
        esc_html( _n( 'This link will expire in %d hour.', 'This link will expire in %d hours.', $expiration_hours, 'subscription-manager-for-stripe' ) ),
        intval( $expiration_hours )
    );
?></p>
