When a submission is inserted from the webservice, no email from the normal webform settings is triggered.

I found a way to make it work :
in file webform_service/resources/submission_resource.inc
for function : webform_service_submission_create($uuid, $submission)

between those lines :

 $sid = webform_submission_insert($webform, webform_service_parse_submission($webform, $submission));
 return webform_service_get_submission($webform, webform_get_submission($webform->nid, $sid, TRUE));

you must add :

$submission = webform_get_submission($webform->nid, $sid);
webform_submission_send_mail($webform, $submission);

so that to whole function looks like :

function webform_service_submission_create($uuid, $submission) {
  // Get the webform entity.
  $webform = webform_service_resource_load($uuid);

  // If the entity exists.
  if ($webform && $submission) {
    module_load_include('inc', 'webform', 'includes/webform.submissions');
	
    $sid = webform_submission_insert($webform, webform_service_parse_submission($webform, $submission));
	
	/* new code */
	$submission = webform_get_submission($webform->nid, $sid);
	webform_submission_send_mail($webform, $submission);
	/* end new code */
	
    return webform_service_get_submission($webform, webform_get_submission($webform->nid, $sid, TRUE));
  }
  else {
    return FALSE;
  }
}
CommentFileSizeAuthor
#1 submission_from-2300823-1.patch748 bytestripper54

Comments

tripper54’s picture

Status: Needs work » Needs review
StatusFileSize
new748 bytes

Rolled this into a patch. Note I changed the name of $submission to remove confusion about reassignment.

Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #1 works. RTBC.

tyler.frankenstein’s picture

Status: Reviewed & tested by the community » Fixed

Looks good, thank you!

Status: Fixed » Closed (fixed)

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