You are here

function webform_email_reply_get_replies in Webform Email Reply 8

Same name and namespace in other branches
  1. 7.2 webform_email_reply.module \webform_email_reply_get_replies()
  2. 7 webform_email_reply.module \webform_email_reply_get_replies()

Check to see if a reply exists already for a submission.

Parameters

string $nid: The node id of the webform

string $sid: The submission id

2 calls to webform_email_reply_get_replies()
DefaultController::webform_email_reply_previous in src/Controller/DefaultController.php
WebformEmailReplyForm::buildForm in src/Form/WebformEmailReplyForm.php
Form constructor.

File

./webform_email_reply.module, line 58
This module provides a way for users to reply to webform submissions within the CMS.

Code

function webform_email_reply_get_replies($webform_id, $sid) {

  // Simple db query to get all the emails replies.
  $previous_replies = \Drupal::database()
    ->select('webform_email_reply', 'r')
    ->fields('r')
    ->condition('r.webform_id', $webform_id)
    ->condition('r.sid', $sid)
    ->execute()
    ->fetchAll();
  return $previous_replies;
}