Documentation for what reason?

This commit is contained in:
Scott Idem
2024-03-08 13:08:54 -05:00
parent 409872ed4d
commit d9ee195590
3 changed files with 63 additions and 63 deletions

View File

@@ -64,6 +64,8 @@ let placeholder_li: key_val = {
if ($slct.event_presenter_id) {
console.log(`Presenter ID selected: ${$slct.event_presenter_id}`);
console.log(`Presenter object selected:`, $slct.event_presenter_obj);
$slct_trigger = 'load__event_presenter_obj';
} else {
$store_current_tab = 'start';
@@ -257,12 +259,17 @@ async function handle_submit_form(event) {
if ($slct.event_presenter_id) {
if ($store_current_tab == 'start' && $slct.event_presenter_id) {
$store_current_tab = 'biograhpy';
send_init_confirm_email();
} else if ($store_current_tab == 'biograhpy' && $slct.event_presenter_id) {
$store_current_tab = 'files';
} else if ($store_current_tab == 'files' && $slct.event_presenter_id) {
$store_current_tab = 'summary';
}
} else {
console.log('No obj ID found!');
}
}
async function handle_submit_form_files(event) {
@@ -412,6 +419,36 @@ async function handle_update__event_presenter({
return ae_promises.update__event_presenter_obj;
}
function send_init_confirm_email() {
let subject = `CHOW 2024 Speaker Hub Link for ${$slct.event_presenter_obj.full_name} (ID: ${$slct.event_presenter_id})`;
let body_html = `<p>Thank you for your submission to the Speaker Hub. You are an integral part of Capitol Hill Ocean Week and we appreciate your participation. If you need to make any changes or updates to your submission, you may access it via the below hyperlink:</p><p>Name: ${$slct.event_presenter_obj.full_name} (Speaker ID: ${$slct.event_presenter_id})</p><p>Use this link to view or update your CHOW 2024 speaker information.<p>Copy and paste link: <a href="${$ae_loc.mod.events.presenter_link}">${$ae_loc.mod.events.presenter_link}</a></p>`
api.send_email({
api_cfg: $ae_api,
from_email: 'noreply+chow@oneskyit.com',
from_name: 'CHOW 2024 Speaker Hub',
to_email: $slct.event_presenter_obj.email,
subject: subject,
body_html: body_html,
});
}
function send_summary_email() {
let subject = `CHOW 2024 Speaker Hub Link for ${$slct.event_presenter_obj.full_name} (ID: ${$slct.event_presenter_id})`;
let body_html = `<p>Thank you for your submission to the Speaker Hub. You are an integral part of Capitol Hill Ocean Week and we appreciate your participation. If you need to make any changes or updates to your submission, you may access it via the link below.</p><p>Name: ${$slct.event_presenter_obj.full_name} (ID: ${$slct.event_presenter_id})</p><p>Professional title: ${$slct.event_presenter_obj.professional_title}</p><p>Affiliations: ${$slct.event_presenter_obj.affiliations}</p><p>Email: ${$slct.event_presenter_obj.email}</p><div>Biography:<pre class="biography pre_wrap">${$slct.event_presenter_obj.biography}</pre></div> <div>Headshot:<div style="max-width: 20em">${placeholder_li.image_headshot}</div></div> <p>Use this link to view or update your CHOW 2024 speaker information.<p>Copy and paste link: <a href="${$ae_loc.mod.events.presenter_link}">${$ae_loc.mod.events.presenter_link}</a></p>`
api.send_email({
api_cfg: $ae_api,
from_email: 'noreply+chow@oneskyit.com',
from_name: 'CHOW 2024 Speaker Hub',
to_email: $slct.event_presenter_obj.email,
subject: subject,
body_html: body_html,
});
}
</script>
<!-- @component This is the Event Presenters modal edit form. -->
@@ -465,18 +502,6 @@ async function handle_update__event_presenter({
on:click={() => {
if (!confirm(`Are you sure you want to send this email to ${$slct.event_presenter_obj.email}?`)) {return false;}
let subject = `CHOW 2024 Speaker Link for ${$slct.event_presenter_obj.full_name} (ID: ${$slct.event_presenter_id})`;
let body_html = `<p>Name: ${$slct.event_presenter_obj.full_name} (speaker ID: ${$slct.event_presenter_id})</p><p>Use this link to view or update your CHOW 2024 speaker information.<p>Copy and paste link: <a href="${$ae_loc.mod.events.presenter_link}">${$ae_loc.mod.events.presenter_link}</a></p>`
api.send_email({
api_cfg: $ae_api,
from_email: 'scott.idem+from@oneskyit.com',
from_name: 'Scott Idem',
to_email: $slct.event_presenter_obj.email,
subject: subject,
body_html: body_html,
});
}}
>
<span class="fas fa-paper-plane mx-1"></span>
@@ -694,7 +719,7 @@ async function handle_update__event_presenter({
</label> -->
</fieldset>
<button
<!-- <button
type="submit"
class="btn variant-glass-primary m-2"
disabled={(!$slct.event_presenter_obj.email || $ae_sess.mod.events.disable_submit__event_presenter_obj)}
@@ -702,28 +727,16 @@ async function handle_update__event_presenter({
console.log('*** Start save and email button clicked ***');
if (!confirm(`This will save your speaker information so far and a confirmation email will be sent to ${$slct.event_presenter_obj.email}.`)) {return false;}
let subject = `CHOW 2024 Speaker Hub Link for ${$slct.event_presenter_obj.full_name} (ID: ${$slct.event_presenter_id})`;
let body_html = `<p>Thank you for your submission to the Speaker Hub. You are an integral part of Capitol Hill Ocean Week and we appreciate your participation. If you need to make any changes or updates to your submission, you may access it via the below hyperlink:</p><p>Name: ${$slct.event_presenter_obj.full_name} (Speaker ID: ${$slct.event_presenter_id})</p><p>Use this link to view or update your CHOW 2024 speaker information.<p>Copy and paste link: <a href="${$ae_loc.mod.events.presenter_link}">${$ae_loc.mod.events.presenter_link}</a></p>`
api.send_email({
api_cfg: $ae_api,
from_email: 'noreply+chow@oneskyit.com',
from_name: 'CHOW 2024 Speaker Hub',
to_email: $slct.event_presenter_obj.email,
subject: subject,
body_html: body_html,
});
}}
>
<span class="fas fa-envelope mx-1"></span>
Save and email
</button>
</button> -->
<button
type="submit"
class="btn variant-glass-primary m-2"
disabled={(!$slct.event_presenter_id || $ae_loc.mod.events.disable_submit__event_presenter_obj)}
disabled={($ae_loc.mod.events.disable_submit__event_presenter_obj)}
on:click={() => {
console.log('*** Save start button clicked ***');
}}
@@ -856,20 +869,7 @@ async function handle_update__event_presenter({
on:click={() => {
if (!confirm(`Are you sure you want to send this email to ${$slct.event_presenter_obj.email}?`)) {return false;}
let subject = `CHOW 2024 Speaker Hub Link for ${$slct.event_presenter_obj.full_name} (ID: ${$slct.event_presenter_id})`;
// let body_html = `<p>Name: ${$slct.event_presenter_obj.full_name} (speaker ID: ${$slct.event_presenter_id})</p><p>Use this link to view or update your CHOW 2024 speaker information.<p>Copy and paste link: <a href="${$ae_loc.mod.events.presenter_link}">${$ae_loc.mod.events.presenter_link}</a></p>`
let body_html = `<p>Thank you for your submission to the Speaker Hub. You are an integral part of Capitol Hill Ocean Week and we appreciate your participation. If you need to make any changes or updates to your submission, you may access it via the link below.</p><p>Name: ${$slct.event_presenter_obj.full_name} (ID: ${$slct.event_presenter_id})</p><p>Professional title: ${$slct.event_presenter_obj.professional_title}</p><p>Affiliations: ${$slct.event_presenter_obj.affiliations}</p><p>Email: ${$slct.event_presenter_obj.email}</p><div>Biography:<pre class="biography pre_wrap">${$slct.event_presenter_obj.biography}</pre></div> <div>Headshot:<div style="max-width: 20em">${placeholder_li.image_headshot}</div></div> <p>Use this link to view or update your CHOW 2024 speaker information.<p>Copy and paste link: <a href="${$ae_loc.mod.events.presenter_link}">${$ae_loc.mod.events.presenter_link}</a></p>`
api.send_email({
api_cfg: $ae_api,
from_email: 'noreply+chow@oneskyit.com',
from_name: 'CHOW 2024 Speaker Hub',
to_email: $slct.event_presenter_obj.email,
subject: subject,
body_html: body_html,
});
send_summary_email();
}}
>
<span class="fas fa-paper-plane mx-1"></span>

View File

@@ -728,9 +728,10 @@ async function handle_update__sponsorship({
}
function send_init_confirm_email() {
console.log(`*** send_init_confirm_email() *** to ${$slct.sponsorship_obj.poc_json.email}.`)
let subject = `CHOW 2024 Sponsor Hub Link for ${$slct.sponsorship_obj.name} (ID: ${$slct.sponsorship_id})`;
let body_html = `<p>Thank you for your submission to the Sponsorships Hub. You are an integral part of Capitol Hill Ocean Week and we appreciate your participation. If you need to make any changes or updates to your submission, you may access it via the below hyperlink:</p><p>Name: ${$slct.sponsorship_obj.name} (Sponsor ID: ${$slct.sponsorship_id})</p><p>Use this link to view or update your CHOW 2024 speaker information.<p>Copy and paste link: <a href="${$ae_loc.mod.sponsorships.link}">${$ae_loc.mod.sponsorships.link}</a></p>`
let body_html = `<p>Thank you for your submission to the Sponsorship Hub. You are an integral part of Capitol Hill Ocean Week and we appreciate your participation. If you need to make any changes or updates to your submission, you may access it via the below hyperlink:</p><p>Name: ${$slct.sponsorship_obj.name} (Sponsor ID: ${$slct.sponsorship_id})</p><p>Use this link to view or update your CHOW 2024 speaker information.<p>Copy and paste link: <a href="${$ae_loc.mod.sponsorships.link}">${$ae_loc.mod.sponsorships.link}</a></p>`
api.send_email({
api_cfg: $ae_api,
@@ -740,7 +741,20 @@ function send_init_confirm_email() {
subject: subject,
body_html: body_html,
});
}
function send_confirm_email() {
let subject = `CHOW 2024 Sponsor Hub Link for ${$slct.sponsorship_obj.name} (ID: ${$slct.sponsorship_id})`;
let body_html = `<p>Thank you for your submission to the Sponsorships Hub. You are an integral part of Capitol Hill Ocean Week and we appreciate your participation. If you need to make any changes or updates to your submission, you may access it via the below hyperlink:</p><p>Level: ${$slct.sponsorship_obj.level_str}</p><p>Name: ${$slct.sponsorship_obj.name} (Sponsor ID: ${$slct.sponsorship_id})</p><p>POC: ${$slct.sponsorship_obj.poc_json.full_name} (${$slct.sponsorship_obj.poc_json.email})</p><p>Use this link to view or update your CHOW 2024 sponsorship information.<p>Copy and paste link: <a href="${$ae_loc.mod.sponsorships.link}">${$ae_loc.mod.sponsorships.link}</a></p>`;
api.send_email({
api_cfg: $ae_api,
from_email: 'noreply+chow@oneskyit.com',
from_name: 'CHOW 2024 Sponsor Hub',
to_email: $slct.sponsorship_obj.poc_json.email,
subject: subject,
body_html: body_html,
});
}
</script>
@@ -2300,25 +2314,13 @@ function send_init_confirm_email() {
<button
class="btn variant-soft-secondary mx-1"
disabled={(!$slct.sponsorship_obj.poc_json.email)}
disabled={($slct.sponsorship_obj.poc_json && !$slct.sponsorship_obj.poc_json.email)}
title="Send confirmation email to POC"
on:click={async () => {
if (!confirm(`Are you sure you want to send this email to ${$slct.sponsorship_obj.poc_json.email}?`)) {return false;}
let subject = `CHOW 2024 Sponsor Hub Link for ${$slct.sponsorship_obj.name} (ID: ${$slct.sponsorship_id})`;
let body_html = `<p>Thank you for your submission to the Sponsorships Hub. You are an integral part of Capitol Hill Ocean Week and we appreciate your participation. If you need to make any changes or updates to your submission, you may access it via the below hyperlink:</p><p>Level: ${$slct.sponsorship_obj.level_str}</p><p>Name: ${$slct.sponsorship_obj.name} (Sponsor ID: ${$slct.sponsorship_id})</p><p>POC: ${$slct.sponsorship_obj.poc_json.full_name} (${$slct.sponsorship_obj.poc_json.email})</p><p>Use this link to view or update your CHOW 2024 sponsorship information.<p>Copy and paste link: <a href="${$ae_loc.mod.sponsorships.link}">${$ae_loc.mod.sponsorships.link}</a></p>`;
await api.send_email({
api_cfg: $ae_api,
from_email: 'noreply+chow@oneskyit.com',
from_name: 'CHOW 2024 Sponsor Hub',
to_email: $slct.sponsorship_obj.poc_json.email,
subject: subject,
body_html: body_html,
});
$ae_sess.mod.sponsorships.submit_status = 'sending email';
send_confirm_email();
}}
>
<span class="fas fa-paper-plane mx-1

View File

@@ -246,13 +246,11 @@ $: if (testing) {
{@html $ae_loc.ds.hub__page__sponsorships__create_info_header}
{:else}
<header>
<h1 class="h1">Information Goes Here</h1>
<h1 class="h1">Sponsor Hub Info Goes Here</h1>
</header>
{/if}
<!-- <section class="btn btn-group"> -->
<section>
{#if $slct.sponsorship_id}
<button
class="btn variant-ghost-primary w-96"
@@ -269,7 +267,7 @@ $: if (testing) {
}}
>
<span class="fas fa-edit mx-1"></span>
Edit Sponsorship {$slct.sponsorship_id}
Edit Sponsor {$slct.sponsorship_id}
</button>
{:else}
<button
@@ -290,14 +288,14 @@ $: if (testing) {
Start Sponsor Submission Form
</button>
{/if}
<!-- </section> -->
</section>
{#if $ae_loc.ds.hub__page__sponsorships__create_info}
{@html $ae_loc.ds.hub__page__sponsorships__create_info}
{:else}
<section>
<div class="alert alert-info">
More information goes here.
More information can go here or this can be hidden.
</div>
</section>
{/if}