Answers.Body: <p>You can write a simple <a href="http://pluginfactory.io" rel="nofollow noreferrer">plugin</a> that listens for the <a href="https://craftcms.com/docs/plugins/events-reference#entries-onSaveEntry" rel="nofollow noreferrer">onSaveEntry</a> event.</p>
  
  <p>When that event fires, you plugin could check the <code>$isNewEntry</code> param to make sure it's a new entry being saved and also check the entry's section to make sure it's the front-end section you're expecting and might as well check <code>craft()-&gt;request-&gt;isSiteRequest()</code> to make sure it's a front-end request.</p>
  
  <p>If all of those match, you would get the users in a group, then loop through all of them sending an email with <a href="https://craftcms.com/classreference/services/EmailService#sendEmail-detail" rel="nofollow noreferrer"><code>craft()-&gt;email-&gt;sendEmail()</code></a> for each user.</p>
  
  <p>Something like (pseudocode):</p>
  
  <pre><code>$element = craft()-&gt;elements-&gt;getElementType(ElementType::Users);
  $element-&gt;group = 'groupHandle';
  $users = $element-&gt;find();
  
  foreach ($users as $user)
  {
      // compose email body, header, etc.
      $success = craft()-&gt;email-&gt;sendEmail($email, $variables);
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-02T22:37:19.523Z
Answers.LastActivityDate: 2017-01-02T22:37:19.523Z
Answers.UserDisplayName: Brad Bell
Body: <p>I've used the front-end entry form in the docs to build a Q&amp;A portal, and it's working great. But I'd like to extend the functionality once the new entry is saved.</p>
  
  <p>I've set the entries up to not be enabled when saved so that a moderation team can later approve them. Is there a way for members of the moderator user group to receive an email every time someone publishes a new question via the front-end form?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-30T23:49:21.463Z
Comments.Text: Are you posting these front-end entries to a custom plugin controller's action or are you going straight through Craft's `entries/saveEntry`?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-02T17:04:27.790Z
Comments.Text: I'm going through `entries/saveEntry`.
Comments.UserDisplayName: Jeremy Fuksa
Tags: <emails><entry-form>
Title: Can I make the front-end entry form send an email to a user group?
ThreadText: # Can I make the front-end entry form send an email to a user group?
  
  (Asked by: username_0 on 2016-12-30)
  
  I've used the front-end entry form in the docs to build a Q&A portal, and it's working great. But I'd like to extend the functionality once the new entry is saved.
  
  I've set the entries up to not be enabled when saved so that a moderation team can later approve them. Is there a way for members of the moderator user group to receive an email every time someone publishes a new question via the front-end form?
  
  **Tags:** emails, entry-form
  
  > **Comments:**
  > **username_1**: Are you posting these front-end entries to a custom plugin controller's action or are you going straight through Craft's `entries/saveEntry`?  
  > **username_0**: I'm going through `entries/saveEntry`.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-01-02. Score: 2
  
  You can write a simple [plugin](http://pluginfactory.io) that listens for the [onSaveEntry](https://craftcms.com/docs/plugins/events-reference#entries-onSaveEntry) event.
  
  When that event fires, you plugin could check the `$isNewEntry` param to make sure it's a new entry being saved and also check the entry's section to make sure it's the front-end section you're expecting and might as well check `craft()->request->isSiteRequest()` to make sure it's a front-end request.
  
  If all of those match, you would get the users in a group, then loop through all of them sending an email with [`craft()->email->sendEmail()`](https://craftcms.com/classreference/services/EmailService#sendEmail-detail) for each user.
  
  Something like (pseudocode):
  
  ```
  $element = craft()->elements->getElementType(ElementType::Users);
  $element->group = 'groupHandle';
  $users = $element->find();
  
  foreach ($users as $user)
  {
      // compose email body, header, etc.
      $success = craft()->email->sendEmail($email, $variables);
  }
  
  ```
  
  
  ---
  
  