How to collect a list of file URLs using Rules and send a single email containing that list? I am using the Rules module to send an email when a content node gets saved/updated.

I have a basic node where users can upload a large number of files and enter an email address to notify someone about the change.

In this example, the Rules Action to Send Email is in a Rules loop, and I get one email per item in list. When I move Send Email to the left, I cannot access the "list_item" variable.

Rules Events:


After saving new content
After updating existing content


Rules Conditions:


Content is of type, Parameter: Content: [node], Content types: BasicPage
NOT Data value is empty, Parameter: Data to check: [node:field-email]


Rules Actions:


Loop
Parameter: List: [node:field-file]
List item: Current list item (list_item)


Send Email
Parameter: To: [node:field-email], Subject: Test [node:title], Message: [list-item:file:url], From: noreply@host.ca
Concatenating text in Rules was difficult when I did it. What I did was to keep two variables: a text array with a starting element value (such as "This is a digest:...") and a text value.

For each iteration of a loop over items to concatenate into a digest, etc. I set the text value to be the first item in the array ([array:0]) and then set the [array:0] value to be a concatenation of the text value and the new value from the loop. When the loop finishes, you know the [array:0] has the digest content.

I do not know why this couldn't work in a simpler way by concatenating the text value each loop directly or using two text values instead of an array. When I tried either of the other ways it only kept the last item or first item of what was being concatenated.