In this guide we will see how to use the Email plugin to send email where you want in your app.
For this example we want to receive an email when a new article's comment is posted and if it contains bad words.
## Introduction
What we want here is to add some custom logic and call the email service when a `Comment` is created via the `POST /comments` endpoint.
To be able to do that, you have first to understand some concepts.
When you create a content type, it generates an API with the following list of [endpoints](../content-api/endpoint.md).
Each of these endpoint triggers a controller action. Here is the list of [controller actions](../concepts/controller.md) that exist by default when a content type is created.
If you check the controller file of your generated API `./api/{content-type}/controller/{Content-Type}.js`, you will see an empty file. It is because all the default logic is managed by Strapi. But you can override these actions with your own code.
And that is what we will do to add our custom code.
## Example
To keep the code example realy easy to follow, we will just have a `Comment` content type and omit the `Author` and `Article` relations.
So lets create a `Comment` content type with just one **Text** field named `content`.
When the content type is created, allow the create function for the Public role.
To check if bad words are in the comment we will use `bad-words` [node module](https://www.npmjs.com/package/bad-words). You will have to install it in your application.
In the [controller documentation](../concepts/controllers.html#extending-a-model-controller) you will find the default implementation of every actions. It will help you overwrite the create logic.