PageSourceSearch

https://sendunlimitedemail.com/sue/mod-mSy-Yzmk.js

js sendunlimitedemail.com collected 2026-10-05 06:24:48 UTC 14,292 bytes, 1 lines download raw bytes

1import{k as U,j as e,V as D,B as h,r as d,e as N,t as m}from"./edge-BOITG1XR.js";import{T as R,a as z,b as u,c as f}from"./mod-B1yn1y2n.js";import{I as r}from"./mod-BUsEZZHX.js";import{L as t}from"./mod-kvo2LsX8.js";import{U as V}from"./mod-Zp5uTWJZ.js";import{L as $}from"./mod-B8aeEFK-.js";import{M as C}from"./mod-CL3oDg-g.js";import{L as y}from"./mod-DxqX0N6D.js";import{W}from"./mod-DeUyQ5eM.js";import{E as K}from"./mod-OWtIy5n2.js";import{E as B}from"./mod-DlaYEcom.js";import{S as G}from"./mod-D5o00wMq.js";import{C as H}from"./mod-CdBQyGbT.js";import{C as J}from"./mod-gbHpssdV.js";const X=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],q=U("wifi-off",X),Q=({userEmail:p})=>{const[o,c]=d.useState(!0),[g,_]=d.useState(!1),[w,S]=d.useState(!1),[j,E]=d.useState(p||""),[x,b]=d.useState(null),[k,F]=d.useState(!1),[l,v]=d.useState({global_smtp_enabled:!1,smtp_host:"",smtp_port:587,smtp_username:"",smtp_password:"",smtp_encryption:"tls",smtp_from_address:"",smtp_from_name:"AIKart DigiLicense",smtp_timeout:30}),[P,T]=d.useState(!1),[M,L]=d.useState("log");d.useEffect(()=>{N.get("/admin/smtp-settings").then(s=>{const a=s.data;v({global_smtp_enabled:!!a.global_smtp_enabled,smtp_host:a.smtp_host||"",smtp_port:a.smtp_port||587,smtp_username:a.smtp_username||"",smtp_password:a.smtp_password||"",smtp_encryption:a.smtp_encryption||"tls",smtp_from_address:a.smtp_from_address||"",smtp_from_name:a.smtp_from_name||"AIKart DigiLicense",smtp_timeout:a.smtp_timeout||30}),T(!!a.has_password),L(a._env_mailer||"log")}).catch(()=>m.error("Failed to load SMTP settings")).finally(()=>c(!1))},[]);const n=(s,a)=>v(O=>({...O,[s]:a})),A=async()=>{_(!0);try{await N.put("/admin/smtp-settings",l),m.success("SMTP settings saved"),l.smtp_password&&(T(!0),v(s=>({...s,smtp_password:""})))}catch(s){const a=s?.response?.data?.message||Object.values(s?.response?.data?.errors||{})[0]?.[0]||"Failed to save SMTP settings";m.error(a)}finally{_(!1)}},I=async()=>{if(!j){m.error("Enter an email address");return}S(!0),b(null);try{const s=await N.post("/admin/smtp-settings/test",{to:j});b({success:!0,message:s.data.message}),m.success("Test email sent!")}catch(s){const a=s?.response?.data?.message||"Failed to send test email";b({success:!1,message:a}),m.error(a)}finally{S(!1)}};if(o)return e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(y,{className:"h-6 w-6 animate-spin text-violet-500"})});const i=l.global_smtp_enabled;return e.jsxs("div",{className:"space-y-5 mt-4",children:[e.jsxs("div",{className:"rounded-2xl border border-slate-100 p-5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-slate-900",children:"Global SMTP"}),e.jsxs("p",{className:"text-sm text-slate-500 mt-0.5",children:["When enabled, all outgoing emails use the settings below instead of the server's ",e.jsx("code",{className:"rounded bg-slate-100 px-1 text-xs",children:".env"})," configuration."]})]}),e.jsx("button",{type:"button",onClick:()=>n("global_smtp_enabled",!i),className:`relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full transition-colors duration-200 focus:outline-none ${i?"bg-violet-600":"bg-slate-200"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 translate-y-0.5 transform rounded-full bg-white shadow-sm ring-0 transition-transform duration-200 ${i?"translate-x-5":"translate-x-1"}`})})]}),e.jsx("div",{className:"mt-3 flex items-center gap-2 text-sm",children:i?e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-emerald-50 px-3 py-1 text-emerald-700 border border-emerald-100",children:[e.jsx(W,{className:"h-3.5 w-3.5"})," Active — using settings below"]}):e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-amber-50 px-3 py-1 text-amber-700 border border-amber-100",children:[e.jsx(q,{className:"h-3.5 w-3.5"})," Disabled — using ",e.jsx("code",{className:"text-xs font-mono ml-1",children:M})," from .env"]})})]}),e.jsxs("div",{className:`rounded-2xl border p-5 space-y-4 transition-opacity ${i?"border-slate-100":"border-slate-100 opacity-60"}`,children:[e.jsx("h3",{className:"font-bold text-slate-900",children:"Connection"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"sm:col-span-2 space-y-1.5",children:[e.jsx(t,{htmlFor:"smtp_host",children:"SMTP Host"}),e.jsx(r,{id:"smtp_host",placeholder:"smtp.gmail.com",value:l.smtp_host,onChange:s=>n("smtp_host",s.target.value)})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(t,{htmlFor:"smtp_port",children:"Port"}),e.jsx(r,{id:"smtp_port",type:"number",placeholder:"587",value:l.smtp_port,onChange:s=>n("smtp_port",parseInt(s.target.value)||587)})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(t,{htmlFor:"smtp_username",children:"Username"}),e.jsx(r,{id:"smtp_username",autoComplete:"off",placeholder:"[email protected]",value:l.smtp_username,onChange:s=>n("smtp_username",s.target.value)})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(t,{htmlFor:"smtp_password",children:["Password",P&&!l.smtp_password&&e.jsx("span",{className:"ml-2 text-xs text-slate-400 font-normal",children:"— saved, leave blank to keep"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(r,{id:"smtp_password",type:k?"text":"password",autoComplete:"new-password",placeholder:P?"••••••••":"App password or SMTP password",value:l.smtp_password,onChange:s=>n("smtp_password",s.target.value),className:"pr-10"}),e.jsx("button",{type:"button",onClick:()=>F(s=>!s),className:"absolute right-3 top-1/2 -translate-y-1/2 z-10 text-slate-400 hover:text-slate-600",children:k?e.jsx(K,{className:"h-4 w-4"}):e.jsx(B,{className:"h-4 w-4"})})]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(t,{htmlFor:"smtp_encryption",children:"Encryption"}),e.jsxs("select",{id:"smtp_encryption",value:l.smtp_encryption,onChange:s=>n("smtp_encryption",s.target.value),className:"w-full rounded-xl border border-input bg-background px-3 py-2 text-sm r
1ing-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[e.jsx("option",{value:"tls",children:"TLS — port 587 (recommended)"}),e.jsx("option",{value:"ssl",children:"SSL — port 465"}),e.jsx("option",{value:"none",children:"None — unencrypted"})]})]})]}),e.jsxs("div",{className:`rounded-2xl border p-5 space-y-4 transition-opacity ${i?"border-slate-100":"border-slate-100 opacity-60"}`,children:[e.jsx("h3",{className:"font-bold text-slate-900",children:"From"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(t,{htmlFor:"smtp_from_name",children:"From Name"}),e.jsx(r,{id:"smtp_from_name",placeholder:"AIKart DigiLicense",value:l.smtp_from_name,onChange:s=>n("smtp_from_name",s.target.value)})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(t,{htmlFor:"smtp_from_address",children:"From Address"}),e.jsx(r,{id:"smtp_from_address",type:"email",placeholder:"[email protected]",value:l.smtp_from_address,onChange:s=>n("smtp_from_address",s.target.value)})]})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:A,disabled:g,className:"flex items-center gap-2 rounded-xl bg-violet-600 px-6 py-2.5 text-sm font-bold text-white hover:bg-violet-700 disabled:opacity-60 transition",children:[g?e.jsx(y,{className:"h-4 w-4 animate-spin"}):null,g?"Saving…":"Save Settings"]})}),e.jsxs("div",{className:"rounded-2xl border border-slate-100 p-5",children:[e.jsx("h3",{className:"font-bold text-slate-900 mb-1",children:"Send Test Email"}),e.jsxs("p",{className:"text-sm text-slate-500 mb-4",children:["Sends using ",i?"the global SMTP settings above":"the default .env mail config","."]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("input",{type:"email",value:j,onChange:s=>E(s.target.value),placeholder:"[email protected]",className:"flex-1 rounded-xl border border-slate-200 px-4 py-2.5 text-sm outline-none focus:border-violet-400 focus:ring-2 focus:ring-violet-100"}),e.jsxs("button",{onClick:I,disabled:w,className:"flex items-center gap-2 rounded-xl bg-violet-600 px-4 py-2.5 text-sm font-bold text-white hover:bg-violet-700 disabled:opacity-60 transition",children:[w?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(G,{className:"h-4 w-4"}),"Send Test"]})]}),x&&e.jsxs("div",{className:`mt-3 flex items-start gap-2 rounded-xl px-4 py-3 text-sm ${x.success?"bg-emerald-50 text-emerald-800 border border-emerald-100":"bg-red-50 text-red-800 border border-red-100"}`,children:[x.success?e.jsx(H,{className:"h-4 w-4 shrink-0 mt-0.5"}):e.jsx(J,{className:"h-4 w-4 shrink-0 mt-0.5"}),x.message]})]}),e.jsxs("div",{className:"rounded-2xl border border-slate-100 p-5",children:[e.jsx("h3",{className:"font-bold text-slate-900 mb-3",children:"Automated Emails"}),e.jsx("div",{className:"space-y-2",children:[{event:"Order Placed",template:"emails/orders/confirmation",trigger:"POST /orders (checkout)"},{event:"Order Shipped",template:"emails/orders/shipped",trigger:"PUT /admin/orders/{id}/status → shipped"},{event:"Order Delivered",template:"emails/orders/delivered",trigger:"PUT /admin/orders/{id}/status → delivered"}].map(s=>e.jsxs("div",{className:"flex items-start gap-3 rounded-xl bg-slate-50 px-4 py-3 text-sm",children:[e.jsx(C,{className:"h-4 w-4 text-violet-500 shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-slate-900",children:s.event}),e.jsxs("p",{className:"text-xs text-slate-400 mt-0.5",children:["Template: ",e.jsxs("code",{className:"font-mono",children:[s.template,".blade.php"]})]}),e.jsxs("p",{className:"text-xs text-slate-400",children:["Triggered: ",e.jsx("code",{className:"font-mono",children:s.trigger})]})]})]},s.event))})]})]})},pe=()=>{const p=localStorage.getItem("user"),o=p?JSON.parse(p):null;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Manage your account settings and preferences"})]}),e.jsxs(R,{defaultValue:"profile",className:"w-full",children:[e.jsxs(z,{children:[e.jsxs(u,{value:"profile",children:[e.jsx(V,{className:"h-4 w-4 mr-2"}),"Profile"]}),e.jsxs(u,{value:"account",children:[e.jsx($,{className:"h-4 w-4 mr-2"}),"Account"]}),e.jsxs(u,{value:"preferences",children:[e.jsx(D,{className:"h-4 w-4 mr-2"}),"Preferences"]}),e.jsxs(u,{value:"email",children:[e.jsx(C,{className:"h-4 w-4 mr-2"}),"Email"]})]}
1),e.jsx(f,{value:"profile",className:"space-y-4 mt-4",children:e.jsxs("div",{className:"border rounded-lg p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Profile Information"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Update your personal information"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(t,{htmlFor:"name",children:"Name"}),e.jsx(r,{id:"name",defaultValue:o?.name||"",disabled:!0})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(t,{htmlFor:"email",children:"Email"}),e.jsx(r,{id:"email",type:"email",defaultValue:o?.email||"",disabled:!0})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(t,{htmlFor:"role",children:"Role"}),e.jsx(r,{id:"role",defaultValue:o?.role==="admin"?"Administrator":"User",disabled:!0})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(h,{disabled:!0,children:"Save Changes"})})]})}),e.jsx(f,{value:"account",className:"space-y-4 mt-4",children:e.jsxs("div",{className:"border rounded-lg p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Account Security"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your password and security settings"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(t,{htmlFor:"current-password",children:"Current Password"}),e.jsx(r,{id:"current-password",type:"password",placeholder:"Enter current password",disabled:!0})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(t,{htmlFor:"new-password",children:"New Password"}),e.jsx(r,{id:"new-password",type:"password",placeholder:"Enter new password",disabled:!0})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(t,{htmlFor:"confirm-password",children:"Confirm Password"}),e.jsx(r,{id:"confirm-password",type:"password",placeholder:"Confirm new password",disabled:!0})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(h,{disabled:!0,children:"Update Password"})})]})}),e.jsx(f,{value:"preferences",className:"space-y-4 mt-4",children:e.jsxs("div",{className:"border rounded-lg p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Platform Preferences"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize your platform experience"})]}),e.jsx("div",{className:"space-y-4",children:[{label:"Email Notifications",desc:"Receive email notifications for new orders",state:"Enabled"},{label:"Order Updates",desc:"Get notified when order status changes",state:"Enabled"},{label:"Product Alerts",desc:"Receive alerts for low stock products",state:"Disabled"}].map(c=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(t,{children:c.label}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c.desc})]}),e.jsx(h,{variant:"outline",size:"sm",disabled:!0,children:c.state})]},c.label))}),e.jsx("div",{className:"flex justify-end",children:e.jsx(h,{disabled:!0,children:"Save Preferences"})})]})}),e.jsx(f,{value:"email",children:e.jsx(Q,{userEmail:o?.email})})]})]})};export{pe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.