-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 06d8141.
- Loading branch information
Showing
2 changed files
with
103 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,43 +56,45 @@ async function subscribe(e) { | |
if (json.error) { | ||
throw new Error(json.error); | ||
} | ||
obj.value = {type: 'Success', message : 'Subscribed'}; | ||
setTimeout(() => acknowledge(), 3000); | ||
if (json.message) { | ||
obj.value = {type: 'Success', message : json.message}; | ||
} else { | ||
obj.value = {type: 'Success', message : "Noted, You'll receive an email to confirm your subscription"}; | ||
} | ||
} catch (e) { | ||
obj.value = { type: 'Error', message: e.message || '' + e }; | ||
} finally { | ||
setTimeout(() => acknowledge(), 5000); | ||
} | ||
} | ||
|
||
</script> | ||
|
||
|
||
<div class="custom-layout"> | ||
<form | ||
class="mt-1 max-w-sm" | ||
action="https://tinyletter.com/stratagems" | ||
method="post" | ||
target="popupwindow" | ||
onsubmit="window.open('https://tinyletter.com/stratagems', 'popupwindow', 'scrollbars=yes,width=800,height=600');return true" | ||
> | ||
<p id="call-to-action"> | ||
Subscribe for updates on Stratagems! | ||
|
||
<section class="gui-toast-group"> | ||
<output role="status" class="gui-toast" v-if="obj.type=='Error'" style="color: #dc2626;">{{obj.message}}</output> | ||
<output role="status" class="gui-toast" v-if="obj.type=='Success'" style="color: #16a34a;">{{obj.message}}</output> | ||
</section> | ||
|
||
<form id="subscribeForm" action="https://etherplay-newsletter-subscription.rim.workers.dev" method="POST"> | ||
<!-- TODO <label for="email" class="sr-only">Email address</label> --> | ||
<p id="call-to-action"> | ||
Subscribe for updates on Stratagems and more from Etherplay! | ||
</p> | ||
<div class="flex gap-x-4"> | ||
<!-- <label for="email-address" class="sr-only">Email address</label> --> | ||
<input | ||
id="email-address" | ||
name="email" | ||
type="email" | ||
autocomplete="email" | ||
required | ||
placeholder="Enter your email" | ||
<div class="flex gap-x-4"> | ||
<input type="hidden" name="main_list" value="[email protected]" /> | ||
<input type="hidden" name="sub_list" value="[email protected]"/> | ||
<input | ||
id="email" | ||
name="email" | ||
type="email" | ||
placeholder="Enter your email" | ||
/> | ||
<button | ||
class="btn" | ||
id="submit" | ||
type="submit" | ||
>Subscribe</button | ||
> | ||
</div> | ||
</form> | ||
<button id="submit" class="btn" @click="subscribe"> | ||
Subscribe | ||
</button> | ||
</div> | ||
</form> | ||
</div> |