I am trying to set up a database which is only viewable by a select group of paying members, i got that part done.
Now on the form i create to submit entries to this database, I would like an email notification to be sent to all members who are signed up as a paying member on one or more of my member plans.
Is this possible, if so how?
If you have the dataset setup and you have a record of your paying members, then you can do multiple address emails as shown in these previous forum posts that you could have found yourself, if you had used the search function as per the forum guidelines before posting.
So regardless of who submits the form used in the tutorials below, the original reply gets sent to yourself as Admin and all the site members who are in the specific dataset can receive the recipient email too.
https://www.wix.com/corvid/forum/community-discussion/sendgrid-emails-not-going-to-multiple-recipients
https://www.wix.com/corvid/forum/corvid-tips-and-updates/sending-an-email-on-form-submission
GOS, thank you for your detailed response. Just to let you know i did do a search in the forum prior to asking the question. I will review these two posts and see if they answer my question.
yeah, this didnt really help me that much, im not understanding how to get the email to go out to subscription members on my site. i have free members and subscription members. the list of these members can change every time someone cancels or someone signs up, it is not a static list of people to get the message.
Okay, that is a shame, so lets think outside the box then.
You have Wix Paid Plans collection that you can query the Paid Plan id field.
https://support.wix.com/en/article/corvid-wix-paid-plans-plans-collection-fields
https://support.wix.com/en/article/corvid-wix-paid-plans-plans-collection-fields#id-_id
So maybe you can simply try querying your Members dataset and getting the emails of only those Members who have the plan id attached to their account and then look at adding those returned email addresses into your email setup, maybe grouped into an array for example?
If you can set it up something like this…
let recipients = ['somebody@somebody.com', 'somebody@somebody.com', 'somebody@somebody.com', 'somebody@somebody.com'];
Then you can take the code from previous links and adjust it to suit your array.
const recipients = recipient.split(";").map( (x) => "to[]=" + x + "&" ).join("");
const data = `from=${sender}&${recipients}&subject=${subject}&text=${body}`;
Or, maybe if you have a dataset where all your paying members details are added into, then you can look at maybe trying to add that dataset to the email setup and simply using the email address field to send the multiple emails too.
Or the most easiest, just query your members collection for their pricing plan and get the email address of those with the specific plan.
https://www.wix.com/corvid/reference/wix-users.User.html#getPricingPlans
Or do it through the backend and get the users with the label for example.
https://www.wix.com/corvid/reference/wix-users-backend.html#UserInfo
labels": [
"contacts-paid_members_approved"
].
Then you can simply use Wix Users Backend API and the emailUser function to send emails to all of those members with that price plan.
https://www.wix.com/corvid/reference/wix-users-backend.html#emailUser
Now watch somebody else come along and give a much easier and simpler way of doing all of this… 
I have a related question, I’m hoping you can help me fill in the piece I am missing here.
I want to do something similar to the initial question. Essentially, query one of my databases to find all members with a certain variable. Then, I want to send them all an automatic email when a user presses a site button.
I have installed the SendGrid NPM and am using it for another purpose, successfully. I just need help figuring out how to perform the database query correctly to generate the recipient email address array @givemeawhisky suggested above, such that the backend code will read it.
Help is greatly appreciated!
If you want the “easy button,” use Ascend by Wix - it has all the features requested by the OP and a lot more.
Ascend by Wix