top of page
Forum Posts
Kyan Lynch
Jan 26, 2021
In Coding with Velo
@Yisrael (Wix) , I really appreciate the articles you've shared on using the sendGrid NPM interface. I have been able to use it successfully to send it to individual email addresses from input fields. Here is what I really want to make happen: A member creates a post, "tagging" several other members The member hits the "post" button, inserting a new item into my "posts" database, and entering the references for the tagged members into that post's multiple reference field labeled "tags" Either upon "post" button press or afterInsert, the email addresses of the post's tagged members are used as "recipients" of my templated email. 1&2 already happen, and I have come up with a shortcut such that an email gets sent to each individual tagged member when the member is tagged (not after the user is finished crafting and submitting the post), and therefore entered into my database. However, this can cause problems because the user creating the post might accidentally tag someone and then remove them, or might end up canceling the post. In addition, I want to be able to send a separate email to other site members who are interested in the topic being posted about, and I need to figure out how to send one email to an array of members based on their stored email addresses. Please let me know if anything is unclear!
0
0
12
Kyan Lynch
Jan 25, 2021
In Coding with Velo
Hello folks, I find myself once again stumped by multiple references. I'll try to explain this as succinctly as I can. Relevant Collections: - EBTMembers: this is the custom membership database that I created for my website. - departmentposts: this is the database collecting the data of member-submitted posts that get displayed in a repeater, similar to a newsfeed - departmentpostlikes: this is the database I use to track which members like which posts. It has two important fields: "post": this is a reference field, referencing the relevant post from the departmentposts database "likers": this is a multiple reference field, referencing the EBTMembers who "liked" a given post. Goal: I want to check to see if the current user is among those who have "liked" each post in the repeater. If yes, I want "fulllike" to expand. If no, I want "emptylike" to expand. Current code (not working): $w.onReady(function () {
$w("#repeater1").onItemReady(($item, itemData, index) =>{
wixData.query("EBTMembers")
.eq("_owner", wixUsers.currentUser.id)
.find()
.then( (results) => {
wixData.isReferenced("EBTMembers", "departmentpostlikes", results.items[0]._id, itemData.id)
.then( (result3) => {
let isReferenced3 = result3;
if (isReferenced3 === true) {
$item("#fulllike").expand()
$item("#emptylike").collapse()}
else{
$item("#fulllike").collapse()
$item("#emptylike").expand()
}
})})})}) Any ideas?
0
1
133
Kyan Lynch
Jan 23, 2021
In Coding with Velo
Hello, I think I am trying to do something fairly simple, but I've tried multiple things and nothing has worked. I have a collection entitled "departmentposts", which collects posts that site members want to share. As part of writing a post, members can "tag" other members. This pulls the tagged member's data from the "members" database into the multiple reference field labeled "tags" in the "departmentposts" collection. To display the posts, I have a repeater to include all of the post information. I also want to display the name of the tagged members. To do so, I added a table to the repeater, and used a filter to include the name of the tagged members in each post's table. So far so good. Here's the problem: the table shows up even when no members have been tagged in the post. In other words, an empty table appears in the repeater even when the multiple reference field labeled "tags" is empty. I simply want to collapse the table if the multiple reference field is empty, for each item in the repeater. I've tried a number of approaches but nothing seems to work. Any one have a solution for me?
0
2
118
Kyan Lynch
More actions
bottom of page