Pass SPServices Result to mailto link in XSLT

Jun 25, 2015 at 2:46 PM
I have a SPServices function that returns the email address of users in a SharePoint group, and I want to set this result as CCs in a mailto link within an existing XSLT dataview.

For example. Here is the mailto link, and where I want to return my SPServices function result.

<a href="mailto:{@Send}?cc=[SPSERVICES RETURN HERE]&subject={@Title}">Generate Email</a>

This may be more of a javascript question than an SPServices question, but I'm wondering what the best method would be to update my mailto link. Should I rewrite the mailto to also use SPServices to return the @Send and @Title values? Can I assign the SPServices result to an XSLT variable and pass that into the mail to?

Jun 25, 2015 at 4:29 PM
I used to try to get things like this to work. Then I realized that there's a sequencing issue.

The XSL transform runs on the server. But the SPServices call runs on the client. So the value from SPServices doesn't exist when your DVWP is evaluated.

Instead, add a unique id or class to the anchor tag and then in the script, select and update the mailto link on the client.