Guest Link Sharing

- Allow links to be emailed to non-contacts by typing their email
- Don't show archived contacts on the dropdown
- Removed unused email send check (handled via queue now)
This commit is contained in:
wrongecho 2024-09-11 17:12:30 +01:00
parent 2e202df3ff
commit 0ad0c2c955
3 changed files with 11 additions and 7 deletions

View File

@ -321,12 +321,7 @@ if (isset($_GET['share_generate_link'])) {
]
];
$mail = addToMailQueue($mysqli, $data);
if ($mail !== true) {
mysqli_query($mysqli,"INSERT INTO notifications SET notification_type = 'Mail', notification = 'Failed to send email to $item_email'");
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Mail', log_action = 'Error', log_description = 'Failed to send email to $item_email regarding $subject. $item_mail', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
}
addToMailQueue($mysqli, $data);
}

View File

@ -12,6 +12,14 @@ function populateShareModal(client_id, item_type, item_ref_id) {
// Show form and generate button
document.getElementById("div_share_link_form").hidden = false;
document.getElementById("div_share_link_generate").hidden = false;
$(document).ready(function() {
$('#share_email').select2({
tags: true,
placeholder: 'Select or type a value',
allowClear: true
});
});
}
function generateShareLink() {

View File

@ -53,7 +53,7 @@
<option value="">-Select a contact-</option>
<?php
$sql_client_contacts_select = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_client_id = $client_id AND contact_email <> '' ORDER BY contact_name ASC");
$sql_client_contacts_select = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_client_id = $client_id AND contact_email <> '' AND contact_archived_at IS NULL ORDER BY contact_name ASC");
while ($row = mysqli_fetch_array($sql_client_contacts_select)) {
$contact_id_select = intval($row['contact_id']);
$contact_name_select = nullable_htmlentities($row['contact_name']);
@ -91,3 +91,4 @@
</div>
</div>
</div>