I've seen some post about removing the view submission link from emails via theming, but this link should be dependent on the permission that deals directly with that.

Seems like a straight forward necessity to use "access own webform submissions" to determine link placement.

FYI: referring to this link: "The results of this submission may be viewed at:"

Comments

quicksketch’s picture

Category: bug » support

Unfortunately this is difficult or impossible to handle, because we don't know whether or not the user receiving the e-mail will have access to view the submission or not. Consider a site in which administrators share logins or use a different e-mail address than the one of the sender, Webform cannot tell if the user receiving the e-mail will have access to view the submission or not. In Webform 3.x, the templating interface for e-mails is built-in and part of the interface and you can template e-mails per component. Considering this makes things much easier, the suggested approach is to use the template editor per-email you send out and remove the link if necessary.

doublejosh’s picture

I can certainly solve the issue with the template, but this seems the way it's suppose to be done.

Seem to me the webform can tell if the user receiving the e-mail will have access to the submission...

$e = %value[email];				// ...or however it's extracted
$u = user_load(array('email',$e));
if( user_access('access own webform submissions',$u) ) {
	// SHOW THE LINK
}

Am I missing something?

quicksketch’s picture

Status: Active » Fixed

Seem to me the webform can tell if the user receiving the e-mail will have access to the submission...

This code does not determine if the user receiving the e-mail (like administrators or editors) can see the submission, it determines if the user *sending* the e-mail can see the submission. In your case this may work fine if you only e-mail the user, but in many situations you'll be sending the e-mail to someone other than the user filling out the form. I think the approach you've taken is fine for your site but not something we can assume is the use-case for all Webforms.

doublejosh’s picture

Oh, I was just speaking about the "e-mail a submission copy" email, rather than the webform's configured email.
You're right in the example I'm testing the wrong email value.
Seems like you can test the account of the email it's being sent to each time it's being sent out.

Looks like I can't solve this in the template because the value of where it's going is not present. Or is it?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.