Hi,
I am new to APEX and trying to make a list view of people from a table with their phone numbers and a button on the right that sends an email to the person in the list item from a template.
I could not find a way to do this so I am currently using a Dynamic Content region instead with the following code.
DECLARE
pageContent clob := '<style>.aptreminder{display: flex; justify-content: flex-end;}</style><ul data-role="listview" class="a-ListView">';
begin
for apt in (
select P_FIRST_NAME || ' ' || P_LAST_NAME AS PNAME,
to_char( NA_DATE_TIME, 'DD-MM-YYYY HH12:MIPM' ) AS APTTIME,
P_PHONE_NUMBER,
P_EMAIL,
NA_DATE_TIME,
NA_DESCRIPTION,
NA_ID
from NEW_APPOINTMENT
inner join PATIENT on NA_PATIENT_ID=P_ID
order by NA_DATE_TIME
) loop
pageContent:= pageContent || '<li class="a-ListView-item ui-body-inherit">' ||
apex_escape.html(apt.PNAME) ||
apex_escape.html(apt.APTTIME) ||
'<p class="ui-li-aside">' ||
apex_escape.html(apt.NA_DESCRIPTION) ||
'</p>' ||
'<div class=aptreminder>'|| apex_escape.html(apt.P_PHONE_NUMBER) ||' <button class="t-Button t-Button--icon js-ignoreChange t-Button--iconLeft lto84999707503097664003_0" type="button"><span class="t-Icon t-Icon--left fa fa-envelope-plus" aria-hidden="true"></span><span class="t-Button-label">Send Reminder</span></button></div>' ||
'</li>';
end loop;
pageContent:= pageContent || '</ul>';
return pageContent;
end;
Is this the correct approach? If so, how do I connect the button to a Send Email process or manually send the email using a saved email template?