Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello, I need a little help please.
I want a webform to be automatically resended via mail, just like when it was submitted.
The involved function I think is "webform_submission_send_mail( $node , $submission );"
the $node parameter is fixed at 178 and the $submission (=sid??) is in a variable called $sid.
I got this error:
Warning: Invalid argument supplied for foreach() in /sites/all/modules/webform/includes/webform.submissions.inc on line 186
Here's the code:
$submission = webform_get_submission(178, $sid);
webform_submission_send_mail(178, $submission);
Can someone help me?
thanks
Comments
Comment #0.0
JFast CreditAttribution: JFast commentedtypo
Comment #0.1
JFast CreditAttribution: JFast commentedtypo
Comment #0.2
JFast CreditAttribution: JFast commentedcode
Comment #0.3
JFast CreditAttribution: JFast commentedcode
Comment #1
quicksketchYou can already do this in the UI by viewing a submission, then there is a "Resend e-mails" link at the top of the page.
I don't normally help with custom coding questions in the Webform queue, but your code is really close:
It should be: