Remove js/mailto.js

This commit is contained in:
2026-08-26 22:35:52 +00:00
parent 657c2e7d43
commit c61d77e1b3
-15
View File
@@ -1,15 +0,0 @@
/**
* Build a `mailto:` URL from an address, subject, and body.
* Subject and body are URL-encoded so the visitor's mail client
* opens pre-filled with the submitted values.
*
* @param {{to?: string, subject?: string, body?: string}} options
* @returns {string}
*/
export function buildMailtoUrl({ to = "", subject = "", body = "" } = {}) {
const params = new URLSearchParams();
if (subject) params.set("subject", subject);
if (body) params.set("body", body);
const query = params.toString();
return query ? `mailto:${to}?${query}` : `mailto:${to}`;
}