From 9c736e01fef53a1e8f3f1f10604b6d61607ff211 Mon Sep 17 00:00:00 2001 From: mmtr <1233880+mmtr@users.noreply.github.com> Date: Thu, 3 Oct 2024 09:16:43 +0200 Subject: [PATCH] Newsletter: Retrieve current user email --- .../plugins/jetpack/extensions/blocks/subscriptions/view.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/plugins/jetpack/extensions/blocks/subscriptions/view.js b/projects/plugins/jetpack/extensions/blocks/subscriptions/view.js index af141a3099d29..44278fa19d0b2 100644 --- a/projects/plugins/jetpack/extensions/blocks/subscriptions/view.js +++ b/projects/plugins/jetpack/extensions/blocks/subscriptions/view.js @@ -55,6 +55,11 @@ domReady( function () { // Injects loading animation in hidden state button.insertAdjacentHTML( 'beforeend', spinner ); + const currentUserEmail = form.querySelector( 'input[type=email]' )?.value ?? ''; + if ( ! currentUserEmail ) { + console.log( 'hey!' ); + } + form.addEventListener( 'submit', function ( event ) { if ( form.resubmitted ) { return;