Question:
I am using wix-data
api on the backend of my website,
the goal is to send an email monthly to the users who has purchased a plan.
I successfully get all users using this code:
const result = await wixData.query("Members/FullData").find({ suppressAuth: true
});
const items = result.items.map(elem => {
return {
email: elem.loginEmail,
firstName: elem.firstName,
lastName: elem.lastName,
company: elem.customfields_contact_company,
position: elem.customfields_contact_position,
website: elem.custom_webseite,
linkedin: elem.custom_linkedin,
instagram: elem.custom_instagram,
}
});
** The Problem **
I cannot get users’ plan to make sure I am sending an email to the user who has the plan.
I have checked out this link: Get paid plans of a user ID
But it did not help. I know that I can get the logged in user plan, but I am running a scheduled job to do this, and I need list of all users.
What I want is quite straightforward, accessing all users’ paid plan on backend code!
Product:
Wix Editor