Skip to content

Commit

Permalink
Fix missing closing tag for email bounce report loop
Browse files Browse the repository at this point in the history
  • Loading branch information
QA2A committed Aug 15, 2024
1 parent dd667f1 commit 4c83618
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions website/templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,13 @@
<td>
{% if not application.resume_views %}
{% if application.company.email %}
<a href="#"
hx-post="/api/bounced_email/"
hx-trigger="click"
hx-target="this"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
onclick="handleBounceReport(this, event, '{{ application.company.email|urlencode }}')"
title="Report Email Bounce">🚫</a>
<a href="#"
hx-post="/api/bounced_email/"
hx-trigger="click"
hx-target="this"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
onclick="handleBounceReport(this, event, '{{ application.company.email|urlencode }}')"
title="Report Email Bounce">🚫</a>
{% endif %}
{% endif %}
</td>
Expand Down Expand Up @@ -439,17 +439,19 @@
</br>
<script>
function handleBounceReport(element, event, email) {
console.log("Email:", email); // Debugging: check if email is defined
let reason = prompt('Please provide a reason for reporting this email as bounced:');
if (reason) {
console.log("Reason:", reason); // Debugging: check if reason is defined

if (email && reason) {
element.setAttribute('hx-params', `email=${email}&reason=${encodeURIComponent(reason)}`);
} else {
alert("Email or reason is undefined or empty."); // Provide feedback if undefined
event.preventDefault(); // Prevents the form from submitting if no reason is provided
}
}




function copyLink(icon) {
icon.style.color = "yellow";
}
Expand Down

0 comments on commit 4c83618

Please sign in to comment.