Trying to get the email notifications to include all the post data.

This commit is contained in:
Scott Idem
2025-03-04 11:33:52 -05:00
parent 6e330a639e
commit 7e92613536
3 changed files with 17 additions and 4 deletions

View File

@@ -12,6 +12,7 @@ import { idaa_loc, idaa_sess, idaa_slct } from '$lib/ae_idaa_stores';
import { posts_func } from '$lib/ae_posts/ae_posts_functions';
import Tiptap_editor from '$lib/element_tiptap_editor.svelte';
export let lq__post_obj: any;
export let lq__post_comment_obj: any;
let prom_api__post_comment_obj: any;
@@ -216,8 +217,16 @@ async function handle_delete_post_comment_obj(
function send_staff_notification_email() {
log_lvl = 2;
if (log_lvl) {
console.log(`*** send_staff_notification_email() *** Post ID: ${$idaa_slct.post_id}`);
console.log(`*** send_staff_notification_email() *** Post ID: ${$idaa_slct.post_id} Post Title: ${$idaa_slct?.post_obj?.title}`);
}
if (log_lvl > 1) {
console.log(`Selected Post Object:`, $idaa_slct.post_obj);
console.log(`Selected Post Comment Object:`, $idaa_slct.post_comment_obj);
console.log($lq__post_obj?.title);
console.log($lq__post_obj?.content);
}
let link_base_url = $ae_loc.site_cfg_json.novi_bb_base_url ?? `${$ae_loc.url_origin}/idaa/bb`;
@@ -253,7 +262,8 @@ function send_staff_notification_email() {
api_cfg: $ae_api,
from_email: $ae_loc.site_cfg_json?.noreply_email ?? 'noreply+idaabb@oneskyit.com',
from_name: $ae_loc.site_cfg_json?.noreply_name ?? 'IDAA BB NoReply',
to_email: $ae_loc.site_cfg_json?.admin_email ?? 'admin+bbcomment@oneskyit.com', // 'scott+idaabb@oneskyit.com', // $idaa_slct.post_comment_obj.email,
// to_email: $ae_loc.site_cfg_json?.admin_email ?? 'admin+bbcomment@oneskyit.com', // 'scott+idaabb@oneskyit.com', // $idaa_slct.post_comment_obj.email,
to_email: 'scott+idaabbstaff@oneskyit.com',
to_name: $ae_loc.site_cfg_json?.admin_name ?? 'IDAA BB Admin',
subject: subject,
body_html: body_html,
@@ -287,7 +297,8 @@ function send_poster_notification_email() {
from_email: $ae_loc.site_cfg_json?.noreply_email ?? 'noreply+idaabb@oneskyit.com',
from_name: $ae_loc.site_cfg_json?.noreply_name ?? 'IDAA BB NoReply',
// to_email: $ae_loc.site_cfg_json?.admin_email ?? 'admin+bbpost@oneskyit.com', // 'scott+idaabb@oneskyit.com',
to_email: $idaa_slct.post_obj.email,
// to_email: $idaa_slct.post_obj.email,
to_email: 'scott+idaabb@oneskyit.com',
to_name: $idaa_slct.post_obj.full_name ?? 'IDAA BB Poster',
subject: subject,
body_html: body_html,

View File

@@ -281,6 +281,7 @@ onDestroy(() => {
{#if $idaa_sess.bb.show__inline_edit__post_comment_id === true}
<Comp__post_comment_obj_id_edit
lq__post_obj={lq__post_obj}
lq__post_comment_obj={lq__post_comment_obj}
/>
{/if}
@@ -297,6 +298,7 @@ onDestroy(() => {
{#if $idaa_sess.bb.show__inline_edit__post_comment_id == post_comment_obj.post_comment_id}
<Comp__post_comment_obj_id_edit
lq__post_obj={lq__post_obj}
lq__post_comment_obj={lq__post_comment_obj}
/>
{:else}

View File

@@ -92,7 +92,7 @@ onMount(() => {
{#if ($ae_loc.trusted_access && $ae_loc.edit_mode) || idaa_post_obj.external_person_id === $idaa_loc.novi_uuid}
<button
on:click={() => {
$idaa_slct.post_id = idaa_post_obj.post_id;
$idaa_slct.post_id = idaa_post_obj?.post_id;
$idaa_slct.post_obj = idaa_post_obj;
// $slct_trigger = 'load__post_obj';