fix: convert LIST_ID env variable to an integer
This commit is contained in:
parent
946d7461a7
commit
1d960c6854
|
@ -8,17 +8,18 @@ export async function submitToListmonk(req, res) {
|
||||||
const listmonkUrl = process.env.LISTMONK_URL;
|
const listmonkUrl = process.env.LISTMONK_URL;
|
||||||
const listmonkUsername = process.env.LISTMONK_USERNAME;
|
const listmonkUsername = process.env.LISTMONK_USERNAME;
|
||||||
const listmonkPassword = process.env.LISTMONK_PASSWORD;
|
const listmonkPassword = process.env.LISTMONK_PASSWORD;
|
||||||
|
|
||||||
// Encode username and password as base64
|
// Encode username and password as base64
|
||||||
const auth = Buffer.from(`${listmonkUsername}:${listmonkPassword}`).toString('base64');
|
const auth = Buffer.from(`${listmonkUsername}:${listmonkPassword}`).toString('base64');
|
||||||
|
|
||||||
|
const listId = parseInt(process.env.LIST_ID, 10);
|
||||||
|
|
||||||
console.log(`Sending request to Listmonk with URL: ${listmonkUrl}`);
|
console.log(`Sending request to Listmonk with URL: ${listmonkUrl}`);
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
email,
|
email,
|
||||||
name,
|
name,
|
||||||
lists: [process.env.LIST_ID],
|
lists: [listId],
|
||||||
fields: { message }
|
fields: { message }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue