Jake Vanderwerf
2026-01-01 8d0e2130627497b55b1a61cbe374bfb309ef2f27
inc/integrations/Helcim.php
@@ -157,6 +157,10 @@
    */
   protected function registerAdditionalHooks(): void
   {
      $this->ensureInitialized();
      if (!$this->isSetUp()) {
         return;
      }
      // User login tracking for security
      add_action('wp_login', [$this, 'trackUserLogin'], 10, 2);
@@ -242,7 +246,7 @@
      <button type="button" class="toggle-cart row" title="Your Cart" data-action="toggle-cart" aria-label="Open Cart" aria-controls="checkout" aria-expanded="false" hidden>
         <?= jvbIcon('shopping-cart')?><span class="abs"></span><span class="abs count"></span>
      </button>
      <aside id="cart">
      <aside id="cart" class="main">
         <form id="checkout" data-form-id="checkout" data-save="checkout">
            <?php
            $tabs = [
@@ -527,6 +531,10 @@
    */
   public function enqueueScripts(): void
   {
      $this->ensureInitialized();
      if (!$this->isSetUp()) {
         return;
      }
      // Helcim JS SDK
      $sdk_url = $this->is_test_mode
         ? 'https://helcim-js-sandbox.helcim.com/v1/helcim.js'
@@ -881,11 +889,10 @@
      // Send notification
      $user = get_user_by('ID', $user_id);
      if ($user) {
         wp_mail(
         JVB()->email()->sendEmail(
            $user->user_email,
            'Security: Password Reset Required',
            'For your security, please reset your password to continue accessing your account and saved payment methods.',
            ['Content-Type: text/html; charset=UTF-8']
         );
      }
   }
@@ -1137,23 +1144,26 @@
   private function sendWelcomeEmail(\WP_User $user, string $reset_key): void
   {
      $site_name = get_bloginfo('name');
      $reset_url = get_home_url(null, "wp-login.php?action=rp&key=$reset_key&login=" . rawurlencode($user->user_login), 'login');
      $reset_url = get_home_url(null, "login?action=rp&key=$reset_key&login=" . rawurlencode($user->user_login), 'login');
      $message = sprintf(
         "Welcome to %s!\n\n" .
         "Your account has been created. Please click the link below to set your password:\n\n" .
         "Your account has been created. Please click the button below to set your password:\n\n" .
         "%s\n\n" .
         "Or, copy and paste the link below:\n\n".
         "%s\n\n" .
         "Once you've set your password, you can:\n" .
         "- View your order history\n" .
         "- Save your favorite items\n" .
         "- Speed up checkout with saved payment methods\n\n" .
         "Thanks,\n%s",
         "If you didn't create this account, please ignore this email.\n\n" .
         "Thanks,\n",
         $site_name,
         $reset_url,
         $site_name
         JVB()->email()->button('Reset Password', $reset_url),
         JVB()->email()->link($reset_url),
      );
      jvbMail(
      JVB()->email()->sendEmail(
         $user->user_email,
         sprintf('[%s] Welcome! Set Your Password', $site_name),
         $message