add clear lineup/availabilities, availability reminders
This commit is contained in:
@@ -110,149 +110,104 @@ function refreshFlags(){
|
||||
|
||||
}
|
||||
|
||||
function copyEmailTable(itemEl, subject, recipients) {
|
||||
// Create container for the HTML
|
||||
// [1]
|
||||
let bcLineup = itemEl.closest(".benchcoach-lineup");
|
||||
var container = document.createElement("div");
|
||||
var tbl = document.createElement("table");
|
||||
|
||||
let thead = tbl.createTHead();
|
||||
let thead_row = thead.insertRow();
|
||||
let thead_row_cell = thead_row.insertCell();
|
||||
thead_row_cell.appendChild(document.createElement("h3").appendChild(document.createTextNode("STARTING LINEUP")));
|
||||
thead_row_cell.colSpan = 3;
|
||||
thead_row_cell.classList.add("title-cell");
|
||||
var tbody = tbl.createTBody();
|
||||
for (row of bcLineup.querySelector(".table-benchcoach-startinglineup").rows) {
|
||||
let tr = tbody.insertRow();
|
||||
cell = tr.insertCell();
|
||||
cell.classList.add("sequence-cell");
|
||||
cell.appendChild(document.createTextNode(parseInt(row.dataset.order) + 1));
|
||||
cell = tr.insertCell();
|
||||
cell.appendChild(document.createTextNode(row.dataset.playerName));
|
||||
cell.classList.add("name-cell");
|
||||
tr.insertCell().appendChild(document.createTextNode(row.dataset.position));
|
||||
}
|
||||
|
||||
if (bcLineup.querySelector(".table-benchcoach-startingpositionalonly").rows.length > 0) {
|
||||
var tr = tbody.insertRow();
|
||||
cell = tr.insertCell();
|
||||
cell.colSpan = 3;
|
||||
cell.appendChild(document.createTextNode("STARTING (POS. ONLY)"));
|
||||
cell.classList.add("title-cell");
|
||||
|
||||
for (row of bcLineup.querySelector(".table-benchcoach-startingpositionalonly").rows) {
|
||||
var tr = tbody.insertRow();
|
||||
cell = tr.insertCell();
|
||||
cell.classList.add("sequence-cell");
|
||||
cell.appendChild(document.createTextNode(""));
|
||||
cell = tr.insertCell();
|
||||
cell.appendChild(document.createTextNode(row.dataset.playerName));
|
||||
cell.classList.add("name-cell");
|
||||
tr.insertCell().appendChild(document.createTextNode(row.dataset.position));
|
||||
function openAvailabilityReminderModal (el, team_id, event_id) {
|
||||
const url = `/${team_id}/event/${event_id}/modal-confirm-availability-reminders/`
|
||||
const form = el.closest('form')
|
||||
const form_data = new FormData (form)
|
||||
fetch(url)
|
||||
.then((response) => {
|
||||
if (response.ok) {
|
||||
return response.text();
|
||||
} else {
|
||||
return Promise.reject(response.text());
|
||||
}
|
||||
}
|
||||
})
|
||||
.then((html) => {
|
||||
const parser = new DOMParser()
|
||||
const modal = parser.parseFromString(html, 'text/html')
|
||||
const modal_node = modal.firstElementChild.querySelector('#modal')
|
||||
modal_node.classList.add('is-open')
|
||||
const modal_node_accept = modal.querySelector('Button[data-confirm=yes]')
|
||||
const checked = Array.from(el.querySelectorAll('input:checked')).map
|
||||
const body = document.querySelector('body')
|
||||
body.appendChild(modal_node)
|
||||
modal_node_accept.addEventListener(
|
||||
"click", ()=>{
|
||||
// const memberIds = form_data.getAll('memberId')
|
||||
const csrf_token = form_data.get('csrfToken')
|
||||
const selected_status_codes = Array.from(document.querySelectorAll('input:checked')).map(e=>e.value)
|
||||
const slots = Array.from(document.querySelectorAll('.lineup-slot')).filter(
|
||||
slot =>{
|
||||
const slot_status_code = slot.querySelector('input[name=availabilityStatusCode]').value
|
||||
return selected_status_codes.includes(slot_status_code)
|
||||
}
|
||||
)
|
||||
const memberIds = slots.map(
|
||||
slot => slot.querySelector('input[name=memberId]').value
|
||||
)
|
||||
|
||||
console.log("sending reminders", el, event_id, memberIds, csrf_token)
|
||||
sendAvailabilityReminder(el, event_id, memberIds, csrf_token)
|
||||
body.removeChild(modal_node)
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
if (bcLineup.querySelector(".table-benchcoach-bench").rows.length > 0) {
|
||||
var tr = tbody.insertRow();
|
||||
cell = tr.insertCell();
|
||||
cell.colSpan = 3;
|
||||
cell.appendChild(document.createTextNode("SUBS"));
|
||||
cell.classList.add("title-cell");
|
||||
function confirmModal(prompt, fn, options) {
|
||||
const url = "/modal-confirm"
|
||||
const params = new URLSearchParams(prompt)
|
||||
url.search = params.toString()
|
||||
|
||||
for (row of bcLineup.querySelector(".table-benchcoach-bench").rows) {
|
||||
var tr = tbody.insertRow();
|
||||
cell = tr.insertCell();
|
||||
cell.classList.add("sequence-cell");
|
||||
availability_status = {
|
||||
None: "UNK",
|
||||
0: "NO",
|
||||
2: "MAY",
|
||||
1: "YES",
|
||||
}[row.dataset.availabilityStatuscode];
|
||||
cell.appendChild(document.createTextNode(availability_status));
|
||||
cell = tr.insertCell();
|
||||
cell.appendChild(document.createTextNode(row.dataset.playerName));
|
||||
cell.classList.add("name-cell");
|
||||
tr.insertCell().appendChild(document.createTextNode(""));
|
||||
fetch(url+"?"+params.toString(), {method:"GET"})
|
||||
.then((response) => {
|
||||
if (response.ok) {
|
||||
return response.text();
|
||||
} else {
|
||||
return Promise.reject(response.text());
|
||||
}
|
||||
}
|
||||
})
|
||||
.then((html) => {
|
||||
const parser = new DOMParser()
|
||||
const modal = parser.parseFromString(html, 'text/html')
|
||||
const modal_node = modal.firstElementChild.querySelector('#modal')
|
||||
modal_node.classList.add('is-open')
|
||||
const modal_node_accept = modal.querySelector('Button[data-confirm=yes]')
|
||||
const body = document.querySelector('body')
|
||||
body.appendChild(modal_node)
|
||||
modal_node_accept.addEventListener("click", ()=>{fn(options);body.removeChild(modal_node)})
|
||||
})
|
||||
}
|
||||
|
||||
if (bcLineup.querySelector(".table-benchcoach-out").rows.length > 0) {
|
||||
var tr = tbody.insertRow();
|
||||
cell = tr.insertCell();
|
||||
cell.colSpan = 3;
|
||||
cell.appendChild(document.createTextNode("OUT"));
|
||||
cell.classList.add("title-cell");
|
||||
function submitClearLineup(options){
|
||||
console.log('clearing lineup...')
|
||||
const {team_id, event_id, event_lineup_id} = options
|
||||
const url = `/${team_id}/event/${event_id}/lineup/${event_lineup_id}/delete`
|
||||
const form = document.querySelector(`#event-lineup-${event_id} form`);
|
||||
const data = new FormData(form);
|
||||
const memberIds = data.getAll('memberId')
|
||||
|
||||
for (row of bcLineup.querySelector(".table-benchcoach-out").rows) {
|
||||
var tr = tbody.insertRow();
|
||||
cell = tr.insertCell();
|
||||
cell.classList.add("sequence-cell");
|
||||
availability_status = {
|
||||
None: "UNK",
|
||||
0: "NO",
|
||||
1: "MAY",
|
||||
2: "YES",
|
||||
}[row.dataset.availabilityStatuscode];
|
||||
cell.appendChild(document.createTextNode(availability_status));
|
||||
tr.insertCell().appendChild(document.createTextNode(row.dataset.playerName));
|
||||
tr.insertCell().appendChild(document.createTextNode(""));
|
||||
}
|
||||
}
|
||||
console.log(url)
|
||||
fetch(url, {method:"POST", body: JSON.stringify({memberIds, event_id}), headers: {"Content-Type": "application/json"}})
|
||||
.finally(()=>{location.reload()});//refresh page
|
||||
}
|
||||
|
||||
container.appendChild(tbl);
|
||||
for (cell of container.getElementsByClassName("title-cell")) {
|
||||
cell.setAttribute("style", "font-weight:bold;background-color:#323669;color:#fff;padding:2px 5px;");
|
||||
}
|
||||
function submitResetAvailabilities(options){
|
||||
const {team_id, event_id} = options
|
||||
const url = `/${team_id}/event/${event_id}/reset_availabilities`
|
||||
const form = document.querySelector(`#event-lineup-${event_id} form`);
|
||||
const data = new FormData(form);
|
||||
const memberIds = data.getAll('memberId')
|
||||
|
||||
for (cell of container.getElementsByClassName("sequence-cell")) {
|
||||
cell.setAttribute("style", "font-weight:bold;padding:2px 5px;");
|
||||
}
|
||||
|
||||
for (cell of container.getElementsByClassName("name-cell")) {
|
||||
cell.setAttribute("style", "width:200px;");
|
||||
}
|
||||
|
||||
// Detect all style sheets of the page
|
||||
var activeSheets = Array.prototype.slice.call(document.styleSheets).filter(function (sheet) {
|
||||
return !sheet.disabled;
|
||||
});
|
||||
|
||||
// Mount the container to the DOM to make `contentWindow` available
|
||||
// [3]
|
||||
document.body.appendChild(container);
|
||||
|
||||
// Copy to clipboard
|
||||
// [4]
|
||||
window.getSelection().removeAllRanges();
|
||||
|
||||
var range = document.createRange();
|
||||
range.selectNode(container);
|
||||
window.getSelection().addRange(range);
|
||||
|
||||
// [5.1]
|
||||
document.execCommand("copy");
|
||||
|
||||
// [5.2]
|
||||
for (var i = 0; i < activeSheets.length; i++) activeSheets[i].disabled = true;
|
||||
|
||||
// [5.3]
|
||||
// document.execCommand('copy')
|
||||
|
||||
// [5.4]
|
||||
for (var i = 0; i < activeSheets.length; i++) activeSheets[i].disabled = false;
|
||||
|
||||
// Remove the container
|
||||
// [6]
|
||||
document.body.removeChild(container);
|
||||
subject_encoded = encodeURIComponent(subject);
|
||||
window.open("readdle-spark://compose?recipient=manager@chihounds.com&subject=" + subject + "&bcc=" + recipients);
|
||||
console.log('submitting...', url)
|
||||
fetch(url, {method:"POST", body: JSON.stringify({memberIds, event_id}), headers: {"Content-Type": "application/json"}})
|
||||
.finally(()=>{location.reload()});//refresh page
|
||||
}
|
||||
|
||||
function emailModal(el, url) {
|
||||
form = el.closest("form");
|
||||
console.log(form)
|
||||
data = new FormData(form);
|
||||
|
||||
fetch(url, {
|
||||
@@ -278,17 +233,15 @@ function emailModal(el, url) {
|
||||
email_modal_node.classList.add('is-open')
|
||||
body.appendChild(email_modal_node)
|
||||
tinymce.init({
|
||||
selector:`#lineup-email-data-${data.get('event_lineup_id')} #email-editor`,
|
||||
selector:`textarea#email-editor`,
|
||||
content_css:"/css/application.css",
|
||||
plugins: 'image',
|
||||
menubar: false,
|
||||
toolbar: 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | outdent indent | image',
|
||||
paste_data_images: true,
|
||||
statusbar:false})
|
||||
// tinymce.activeEditor.setContent("Team,")
|
||||
// lineup_table_div.innerHTML = lineup_table
|
||||
// email_modal.classList.add("is-open");
|
||||
// email_modal.querySelector(".Modal-body").innerHTML = html;
|
||||
tinymce.remove();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -340,184 +293,6 @@ async function onSubmit(form, event) {
|
||||
}, 3000)
|
||||
}
|
||||
|
||||
function copyEmailTable(itemEl, subject, recipients) {
|
||||
// Create container for the HTML
|
||||
// [1]
|
||||
let bcLineup = itemEl.closest(".event-lineup");
|
||||
var container = document.createElement("div");
|
||||
var tbl = document.createElement("table");
|
||||
|
||||
let thead = tbl.createTHead();
|
||||
let thead_row = thead.insertRow();
|
||||
let thead_row_cell = thead_row.insertCell();
|
||||
thead_row_cell.appendChild(document.createElement("h3").appendChild(document.createTextNode("STARTING LINEUP")));
|
||||
thead_row_cell.colSpan = 3;
|
||||
thead_row_cell.classList.add("title-cell");
|
||||
var tbody = tbl.createTBody();
|
||||
|
||||
lineup_slots_starting = bcLineup.querySelectorAll(".starting .slot-set .lineup-slot");
|
||||
|
||||
for (node of lineup_slots_starting) {
|
||||
console.log("node", node);
|
||||
let tr = tbody.insertRow();
|
||||
cell = tr.insertCell();
|
||||
cell.classList.add("sequence-cell");
|
||||
sequence = node.querySelector("input[name*='sequence']").value;
|
||||
console.log(sequence);
|
||||
cell.appendChild(document.createTextNode(parseInt(sequence) + 1));
|
||||
name = node.querySelector("div:has(.lastname)");
|
||||
cell = tr.insertCell();
|
||||
cell.appendChild(document.createTextNode(name.textContent));
|
||||
cell.classList.add("name-cell");
|
||||
position_label = node.querySelector("input[name*='label']").value;
|
||||
tr.insertCell().appendChild(document.createTextNode(position_label));
|
||||
}
|
||||
|
||||
lineup_slots_position_only = bcLineup.querySelector(".position-only .slot-set .lineup-slot");
|
||||
console.log("lineup slots position", lineup_slots_position_only);
|
||||
if (lineup_slots_position_only.length > 0) {
|
||||
var tr = tbody.insertRow();
|
||||
cell = tr.insertCell();
|
||||
cell.colSpan = 3;
|
||||
cell.appendChild(document.createTextNode("STARTING (POS. ONLY)"));
|
||||
cell.classList.add("title-cell");
|
||||
|
||||
for (node of lineup_slots_position_only) {
|
||||
var tr = tbody.insertRow();
|
||||
cell = tr.insertCell();
|
||||
cell.classList.add("sequence-cell");
|
||||
cell.appendChild(document.createTextNode(""));
|
||||
cell = tr.insertCell();
|
||||
name = node.querySelector("div:has(.lastname)");
|
||||
cell.appendChild(document.createTextNode(name.textCotent));
|
||||
cell.classList.add("name-cell");
|
||||
position_label = node.querySelector("input[name*='label']").value;
|
||||
tr.insertCell().appendChild(document.createTextNode(position_label));
|
||||
}
|
||||
}
|
||||
|
||||
lineup_slots_bench = bcLineup.querySelector(".bench .slot-set .lineup-slot");
|
||||
if (lineup_slots_bench > 0) {
|
||||
var tr = tbody.insertRow();
|
||||
cell = tr.insertCell();
|
||||
cell.colSpan = 3;
|
||||
cell.appendChild(document.createTextNode("SUBS"));
|
||||
cell.classList.add("title-cell");
|
||||
|
||||
for (node of lineup_slots_bench) {
|
||||
var tr = tbody.insertRow();
|
||||
cell = tr.insertCell();
|
||||
cell.classList.add("sequence-cell");
|
||||
|
||||
div_avail_code = node.querySelector("div[class*='availability-status-code']");
|
||||
if (div_with_avail_code.classList.includes("availability-status-code-1")) {
|
||||
cell.appendChild(document.createTextNode("YES"));
|
||||
} else if (div_with_avail_code.classList.includes("availability-status-code-2")) {
|
||||
cell.appendChild(document.createTextNode("MAY"));
|
||||
} else if (div_with_avail_code.classList.includes("availability-status-code-0")) {
|
||||
cell.appendChild(document.createTextNode("NO"));
|
||||
} else {
|
||||
cell.appendChild(document.createTextNode("UNK"));
|
||||
}
|
||||
cell = tr.insertCell();
|
||||
name = node.querySelector("div:has(.lastname)");
|
||||
cell.appendChild(document.createTextNode(name.textCotent));
|
||||
cell.classList.add("name-cell");
|
||||
tr.insertCell().appendChild(document.createTextNode(""));
|
||||
}
|
||||
}
|
||||
|
||||
lineup_slots_out = bcLineup.querySelector(".out .slot-set .lineup-slot");
|
||||
if (lineup_slots_out > 0) {
|
||||
var tr = tbody.insertRow();
|
||||
cell = tr.insertCell();
|
||||
cell.colSpan = 3;
|
||||
cell.appendChild(document.createTextNode("OUT"));
|
||||
cell.classList.add("title-cell");
|
||||
|
||||
for (node of lineup_slots_out) {
|
||||
var tr = tbody.insertRow();
|
||||
cell = tr.insertCell();
|
||||
cell.classList.add("sequence-cell");
|
||||
div_avail_code = node.querySelector("div[class*='availability-status-code']");
|
||||
if (div_with_avail_code.classList.includes("availability-status-code-1")) {
|
||||
cell.appendChild(document.createTextNode("YES"));
|
||||
} else if (div_with_avail_code.classList.includes("availability-status-code-2")) {
|
||||
cell.appendChild(document.createTextNode("MAY"));
|
||||
} else if (div_with_avail_code.classList.includes("availability-status-code-0")) {
|
||||
cell.appendChild(document.createTextNode("NO"));
|
||||
} else {
|
||||
cell.appendChild(document.createTextNode("UNK"));
|
||||
}
|
||||
cell = tr.insertCell();
|
||||
name = node.querySelector("div:has(.lastname)");
|
||||
cell.appendChild(document.createTextNode(name.textCotent));
|
||||
cell.classList.add("name-cell");
|
||||
tr.insertCell().appendChild(document.createTextNode(""));
|
||||
}
|
||||
}
|
||||
|
||||
container.appendChild(tbl);
|
||||
for (cell of container.getElementsByClassName("title-cell")) {
|
||||
cell.setAttribute("style", "font-weight:bold;background-color:#323669;color:#fff;padding:2px 5px;");
|
||||
}
|
||||
|
||||
for (cell of container.getElementsByClassName("sequence-cell")) {
|
||||
cell.setAttribute("style", "font-weight:bold;padding:2px 5px;");
|
||||
}
|
||||
|
||||
for (cell of container.getElementsByClassName("name-cell")) {
|
||||
cell.setAttribute("style", "width:200px;");
|
||||
}
|
||||
|
||||
// Detect all style sheets of the page
|
||||
var activeSheets = Array.prototype.slice.call(document.styleSheets).filter(function (sheet) {
|
||||
return !sheet.disabled;
|
||||
});
|
||||
|
||||
// Mount the container to the DOM to make `contentWindow` available
|
||||
// [3]
|
||||
document.body.appendChild(container);
|
||||
|
||||
// Copy to clipboard
|
||||
// [4]
|
||||
window.getSelection().removeAllRanges();
|
||||
|
||||
var range = document.createRange();
|
||||
range.selectNode(container);
|
||||
window.getSelection().addRange(range);
|
||||
|
||||
// [5.1]
|
||||
document.execCommand("copy");
|
||||
|
||||
// [5.2]
|
||||
for (var i = 0; i < activeSheets.length; i++) activeSheets[i].disabled = true;
|
||||
|
||||
// [5.3]
|
||||
// document.execCommand('copy')
|
||||
|
||||
// [5.4]
|
||||
for (var i = 0; i < activeSheets.length; i++) activeSheets[i].disabled = false;
|
||||
|
||||
// Remove the container
|
||||
// [6]
|
||||
document.body.removeChild(container);
|
||||
subject_encoded = encodeURIComponent(subject);
|
||||
window.open("readdle-spark://compose?recipient=manager@chihounds.com&subject=" + subject + "&bcc=" + recipients);
|
||||
}
|
||||
|
||||
function toggleChildSlots (element) {
|
||||
console.log(element);
|
||||
console.log(element.closest(".slot-set"))
|
||||
for (lineup_slot of document.querySelectorAll("[id^=lineup-out] .lineup-slot")) {
|
||||
console.log(lineup_slot)
|
||||
const cells = lineup_slot.querySelectorAll('.Panel-cell:has(.sequence), .Panel-cell:has(.drag-handle), .Panel-cell:has(.position-select-box), button:has(+.position-label-flags)')
|
||||
Array.from(cells).forEach(cell=>{
|
||||
cell.classList.toggle('u-hidden')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async function copyEmailTable (element) {
|
||||
// range=document.createRange();
|
||||
// window.getSelection().removeAllRanges();
|
||||
@@ -581,6 +356,30 @@ async function copyEmailTable (element) {
|
||||
window.getSelection().removeAllRanges();
|
||||
}
|
||||
|
||||
function toggleChildSlots (element) {
|
||||
console.log(element);
|
||||
console.log(element.closest(".slot-set"))
|
||||
for (lineup_slot of document.querySelectorAll("[id^=lineup-out] .lineup-slot")) {
|
||||
console.log(lineup_slot)
|
||||
const cells = lineup_slot.querySelectorAll('.Panel-cell:has(.sequence), .Panel-cell:has(.drag-handle), .Panel-cell:has(.position-select-box), button:has(+.position-label-flags)')
|
||||
Array.from(cells).forEach(cell=>{
|
||||
cell.classList.toggle('u-hidden')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function initSlots () {
|
||||
const slots = Array.from(document.querySelectorAll('.lineup-slot'))
|
||||
slots.forEach(slot=>{
|
||||
if (slot.dataset.initialSlotset) {
|
||||
const parent = document.querySelector(`#${slot.dataset.initialSlotset} .slot-set`)
|
||||
parent.appendChild(slot)
|
||||
slot.removeAttribute('data-initial-slotset')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function insertLineup(direction, teamId, eventId, element) {
|
||||
const currentUrl = window.location.href;
|
||||
let search_params
|
||||
@@ -636,27 +435,6 @@ function insertLineup(direction, teamId, eventId, element) {
|
||||
|
||||
}
|
||||
|
||||
function initSlots () {
|
||||
const slots = Array.from(document.querySelectorAll('.lineup-slot'))
|
||||
slots.forEach(slot=>{
|
||||
if (slot.dataset.initialSlotset) {
|
||||
const parent = document.querySelector(`#${slot.dataset.initialSlotset} .slot-set`)
|
||||
parent.appendChild(slot)
|
||||
slot.removeAttribute('data-initial-slotset')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function openAvailabilityReminderModal (el, event_id) {
|
||||
console.log(el)
|
||||
const form = el.closest("form");
|
||||
console.log(`#availability-reminder-modal-${event_id}`)
|
||||
data = new FormData(form);
|
||||
const modal = form.querySelector(`#availability-reminder-modal-${event_id}`)
|
||||
modal.classList.toggle('is-open')
|
||||
|
||||
}
|
||||
|
||||
function initPage (){
|
||||
colorPositions();
|
||||
initSlots();
|
||||
@@ -701,24 +479,11 @@ function initPage (){
|
||||
}
|
||||
}
|
||||
|
||||
function mailToLink(el, protocol='mailto') {
|
||||
console.log(el)
|
||||
console.log(el.dataset)
|
||||
const {to, bcc, subject} = el.dataset
|
||||
const params = new URLSearchParams({
|
||||
bcc, subject: encodeURIComponent(subject),
|
||||
})
|
||||
const url = `${protocol}:${to}?${params}`
|
||||
console.log(url)
|
||||
// location.href=`mailto:${to}${params}`
|
||||
const windowRef = window.open(url, '_blank');
|
||||
windowRef.focus();
|
||||
}
|
||||
|
||||
function sparkMailToLink(el) {
|
||||
const protocol = 'readdle-spark'
|
||||
const {to, bcc, subject} = el.dataset
|
||||
const url = `${protocol}://compose?recipient=${to}&bcc=${bcc}&subject=${encodeURIComponent(subject)}`
|
||||
function mailToLink(el, protocol) {
|
||||
const {to, bcc} = el.dataset
|
||||
const subject = document.getElementById('email-subject').value
|
||||
const email_body = document.getElementById('email-editor').value
|
||||
const url = `${protocol}://compose?recipient=${to}&bcc=${bcc}&subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(email_body)}`
|
||||
console.log(url)
|
||||
// location.href=`mailto:${to}${params}`
|
||||
const windowRef = window.open(url, '_blank');
|
||||
|
||||
Reference in New Issue
Block a user