I aim for an email to be sent to the owner when the first comment is posted and subsequently to everyone in the comment field when a new comment is posted.
But the first comment is sent to the commenter instead of the owner.
What am I doing wrong?
I don’t think that your configuration will be working fine with multiple comments from the same user.
Here’s my solution idea
Create a query column with these filters:
ID is this row → ID
AND
Commenter email is not this row → commenter email
Create a joined list column for emails
Set the source to query column → commenter email.
Create a template column
Set the template to: $commenters, $owner
Replace:
$commenters → joinedlist
$owner → your owner lookup email column
That would make a joined list with owner email included.
Create a Unique Elements column
Set the source to the template column.
In your workflow, remove the condition and keep only one send email. Set the emails to the unique elements column.
When you say the “owner”, do you mean the person who posted the comment, or the one who “owns” the entity you are commenting on? I assume the second case?
“owner” means the person who made the post being commented on
Since you’re interacting with the Comments table, I think the logic should be:
- Add a relation column that relates the current comment’s “post ID” (so the parent entity) to itself, return multiple matches.
- Add a rollup to count the number of matches.
- If the count is 0, you send the email to the “owner”. Else send to your joined list of user emails.
I’ve tried if-then-else as you suggested and if I’m viewing/logged in as a user and commenting on my own post as the first one, it works, but if I’m viewing/logged in as a user and commenting as the first one, it doesn’t work.
I have tried testing with the owner commenting first (recipient of the email and the user replying to the first comment. Then they both receive an email and it is not intended that the user should receive an email when the user comments.
Is it possible to set it up the way I want?
I would prefer to avoid sending an email to the person who comments.
NB. Made an array column, where the signed in user is removed from the “joined list” so that issue is solved:-)
Could I cheat it by having a row generated in the comments table when a post was made?
Can you show me in some screenshots how you set it up?
What’s the “remove duplicates” array?
@dorthe_petersen did you try to implement this solution?