<p>For those that are looking for a plugin that simply notifies users (<em>without</em> all the overhead), take a look at <a href="https://github.com/taylordaughtry/brief" rel="noreferrer">Brief</a>. It's a <strong>super-light</strong> plugin that simply notifies users whenever a new entry is added to a Section.</p>

<p>If anybody has a specific need for it, I'd be glad to add features.</p>

<p>More information: <a href="https://github.com/taylordaughtry/brief" rel="noreferrer">Brief</a></p>

CC BY-SA 3.0
2015-09-17T05:17:11.927Z
Nice work! You should submit it to [Straight Up Craft](https://straightupcraft.com/craft-plugins), the official unofficial plugins listing.
Lindsey D
CC BY-SA 3.0
2015-09-17T03:00:27.230Z
2015-09-17T03:00:27.230Z
Taylor Daughtry
<p>Alternatively, you could get in touch with Ben Parizek of Barrel Strength Design who has a plugin called <a href="http://sprout.barrelstrengthdesign.com/craft-plugins/email">Sprout Email</a>. Currently in beta but you can request a preview.</p>

<p>I am using it as we speak.</p>

CC BY-SA 3.0
2014-06-21T14:06:08.590Z
2014-06-21T14:06:08.590Z
Jérôme Coupé
<p>Or, have a look at <a href="https://github.com/objectivehtml/Postmaster-for-Craft-CMS" rel="nofollow">Postmaster</a>, which works a treat!</p>

CC BY-SA 3.0
2015-01-21T03:10:03.197Z
2015-01-21T03:10:03.197Z
crawf
<p>Currently there isn't a native way to do this, but you could <a href="http://buildwithcraft.com/docs/plugins/introduction" rel="noreferrer">write a plugin</a> which would work like this:</p>

<ul>
<li><p>Wait for an <a href="http://buildwithcraft.com/docs/plugins/hooks-and-events" rel="noreferrer">event</a> like: <a href="http://buildwithcraft.com/docs/plugins/events-reference#content-onSaveContent" rel="noreferrer"><code>content.onSaveContent</code></a> or <a href="http://buildwithcraft.com/docs/plugins/events-reference#entries-onSaveEntry" rel="noreferrer"><code>entries.onSaveEntry</code></a></p></li>
<li><p>Get all users from a specific usergroup using the <a href="http://buildwithcraft.com/docs/templating/elementcriteriamodel" rel="noreferrer">ElementCriteriaModel</a>.</p></li>
<li><p>Use the <a href="http://buildwithcraft.com/docs/apis/emailservice" rel="noreferrer">EmailService</a> to send a mail to each of them.</p></li>
</ul>

<p>.</p>

<p><strong>Quick-and-Dirty:</strong></p>

<pre class="lang-php prettyprint-override"><code>public function init()
{
    parent::init();

    //Event: onSaveEntry
    craft()-&gt;on('entries.saveEntry', function(Event $event) {

        //Get all users from UserGroup
        $user_criteria = craft()-&gt;elements-&gt;getCriteria(ElementType::User);
        $user_criteria-&gt;groupId = '1';
        $users = $user_criteria-&gt;find();

        //Send to each User
        foreach ($users as $user) {
            //Send Mail
            $email = new EmailModel();
            $email-&gt;toEmail = $user-&gt;email;
            $email-&gt;subject = 'Heyyyyy';
            $email-&gt;body    = 'How you doin?';

            craft()-&gt;email-&gt;sendEmail($email);
        }
    });
}
</code></pre>

CC BY-SA 3.0
2014-06-22T09:24:24.657Z
Thanks for this Victor, I am trying to get into simple plugin development so this is really useful. Is there are very simple boilerplate set of example files to learn how to add what you have given me and make it work as a plugin?
Gareth
CC BY-SA 3.0
2014-06-22T10:28:30.303Z
Except for the $user_criteria part, which I got from the 'G+ Dev Group' the rest of the code is copied out of the docs (see my links in the list above). Also 'reverse-engineering' other peoples plugins explains a lot (list: http://straightupcraft.com/craft-plugins ). Otherwise it's 'Try & Error' or asking ;)
Victor
CC BY-SA 3.0
2014-06-22T10:30:50.033Z
Oh, and check out: http://buildwithcraft.com/docs/plugins/introduction which will help you get started. The `init()` functions goes into the main plugin-file.
Victor
CC BY-SA 3.0
2014-06-21T11:07:12.487Z
2014-07-16T11:43:39.460Z
2014-07-16T11:43:39.460Z
Victor
<p>Is it possible for a user group to be notified by email when a post is submitted using either the backend or a form on the front end?</p>

<form><emails>
Email Notification When Post Submitted
# Email Notification When Post Submitted

(Asked by: username_0 on 2014-06-21)

Is it possible for a user group to be notified by email when a post is submitted using either the backend or a form on the front end?

**Tags:** form, emails

---

## 4 answers

### Answer by username_5 on 2014-06-21. Score: 7 | Accepted answer

Currently there isn't a native way to do this, but you could write a plugin which would work like this:

Wait for an event like: content.onSaveContent or entries.onSaveEntry
Get all users from a specific usergroup using the ElementCriteriaModel.
Use the EmailService to send a mail to each of them.

.
Quick-and-Dirty:
public function init()
{
    parent::init();

    //Event: onSaveEntry
    craft()->on('entries.saveEntry', function(Event $event) {

        //Get all users from UserGroup
        $user_criteria = craft()->elements->getCriteria(ElementType::User);
        $user_criteria->groupId = '1';
        $users = $user_criteria->find();

        //Send to each User
        foreach ($users as $user) {
            //Send Mail
            $email = new EmailModel();
            $email->toEmail = $user->email;
            $email->subject = 'Heyyyyy';
            $email->body    = 'How you doin?';

            craft()->email->sendEmail($email);
        }
    });
}

> **Comments:**
> **username_0**: Thanks for this Victor, I am trying to get into simple plugin development so this is really useful. Is there are very simple boilerplate set of example files to learn how to add what you have given me and make it work as a plugin?  
> **username_5**: Except for the $user_criteria part, which I got from the 'G+ Dev Group' the rest of the code is copied out of the docs (see my links in the list above). Also 'reverse-engineering' other peoples plugins explains a lot (list: http://straightupcraft.com/craft-plugins ). Otherwise it's 'Try & Error' or asking ;)  
> **username_5**: Oh, and check out: http://buildwithcraft.com/docs/plugins/introduction which will help you get started. The `init()` functions goes into the main plugin-file.  

---

### Answer by username_1 on 2015-09-17. Score: 6

For those that are looking for a plugin that simply notifies users (*without* all the overhead), take a look at [Brief](https://github.com/taylordaughtry/brief). It's a **super-light** plugin that simply notifies users whenever a new entry is added to a Section.

If anybody has a specific need for it, I'd be glad to add features.

More information: [Brief](https://github.com/taylordaughtry/brief)

> **Comments:**
> **username_2**: Nice work! You should submit it to [Straight Up Craft](https://straightupcraft.com/craft-plugins), the official unofficial plugins listing.  

---

### Answer by username_3 on 2014-06-21. Score: 4

Alternatively, you could get in touch with Ben Parizek of Barrel Strength Design who has a plugin called [Sprout Email](http://sprout.barrelstrengthdesign.com/craft-plugins/email). Currently in beta but you can request a preview.

I am using it as we speak.


---

### Answer by username_4 on 2015-01-21. Score: 1

Or, have a look at [Postmaster](https://github.com/objectivehtml/Postmaster-for-Craft-CMS), which works a treat!


---

