Fix script
This commit is contained in:
parent
5b070efc4f
commit
9e55e9ee1e
1 changed files with 6 additions and 9 deletions
|
@ -52,11 +52,7 @@ export function createClient({ host, key }) {
|
||||||
body: JSON.stringify(convertObjectKeys(config, snakeCase)),
|
body: JSON.stringify(convertObjectKeys(config, snakeCase)),
|
||||||
});
|
});
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
const parsed = responseSchema.parse(data);
|
return data;
|
||||||
if (parsed.status === "error") {
|
|
||||||
throw new PostalError(parsed.data.code, parsed.data.message);
|
|
||||||
}
|
|
||||||
return parsed.data;
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -85,8 +81,8 @@ for (const sub of unconfirmedSubmissions) {
|
||||||
const url = new URL(`${sub.language}/confirm/${sub.confirmationToken}`, process.env.PUBLIC_URL);
|
const url = new URL(`${sub.language}/confirm/${sub.confirmationToken}`, process.env.PUBLIC_URL);
|
||||||
const values = {
|
const values = {
|
||||||
subject: title,
|
subject: title,
|
||||||
from: `Let's stop dirty money <vig@re-set.cz>`,
|
from: `Let's stop dirty money <send@spinaveprachy.cz>`,
|
||||||
to: sub.email,
|
to: [sub.email],
|
||||||
htmlBody: `<!DOCTYPE html>
|
htmlBody: `<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
@ -147,6 +143,7 @@ for (const sub of unconfirmedSubmissions) {
|
||||||
</body>
|
</body>
|
||||||
</html>`,
|
</html>`,
|
||||||
};
|
};
|
||||||
console.log("values", values);
|
// console.log("values", values);
|
||||||
// mailClient.send(values
|
const result = await mailClient.send(values);
|
||||||
|
console.log(result);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue