File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,6 +159,33 @@ invariant(i18n, "No homepage content found");
159159 currentCount + 1
160160 ).toLocaleString();
161161 }
162+
163+ try {
164+ const txEmailResponse = await fetch(
165+ "https://listmonk.skeptrune.com/api/tx",
166+ {
167+ method: "POST",
168+ headers: {
169+ "Content-Type": "application/json; charset=utf-8",
170+ Authorization: `Basic ${btoa(`${apiUsername}:${apiKey}`)}`,
171+ },
172+ body: JSON.stringify({
173+ subscriber_email: email,
174+ template_id: 5,
175+ content_type: "html",
176+ }),
177+ }
178+ );
179+ if (!txEmailResponse.ok) {
180+ console.error(
181+ "Failed to send welcome email:",
182+ txEmailResponse.status,
183+ await txEmailResponse.text()
184+ );
185+ }
186+ } catch (txError) {
187+ console.error("Error sending welcome email:", txError);
188+ }
162189 } else if (response.status === 409) {
163190 htmlSubmitButton.textContent = "Already Subscribed";
164191 htmlSubmitButton.disabled = false;
You can’t perform that action at this time.
0 commit comments