# Kibana Custom Plugin Sending Emails

**URL:** <https://discuss.elastic.co/t/kibana-custom-plugin-sending-emails/167029>\
**Category:** Kibana\
**Created:** [February 4, 2019, 9:28pm UTC](https://discuss.elastic.co/t/kibana-custom-plugin-sending-emails/167029 "2019-02-04T21:28:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbking](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bbking/32/77563_2.png) [@bbking](https://discuss.elastic.co/u/bbking)\
**Post date:** [February 4, 2019, 9:28pm UTC](https://discuss.elastic.co/t/kibana-custom-plugin-sending-emails/167029/1 "2019-02-04T21:28:30Z")

</div>

Hi, I implemented a custom plugin app in Kibana and it will send periodical emails daily. I want to start sending emails in background once Kibana server is started. How should I start a service once Kibana is started? There is no front end interactions with the plugin and I'm quite confused about where should I add the logic that calls "sending emails". Thanks!

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [February 5, 2019, 7:59pm UTC](https://discuss.elastic.co/t/kibana-custom-plugin-sending-emails/167029/2 "2019-02-05T19:59:27Z")

</div>

The best way to figure out how plugins work is to view the plugins that ship with Kibana. For example, the maps plugin is setup here [https://github.com/elastic/kibana/blob/master/x-pack/plugins/maps/index.js#L58](https://github.com/elastic/kibana/blob/master/x-pack/plugins/maps/index.js#L58). The `init` method is called when the plugin is loaded allowing the plugin to register REST endpoints and so on. You could put your serverside logic in a similar place in your plugin.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 5, 2019, 7:59pm UTC](https://discuss.elastic.co/t/kibana-custom-plugin-sending-emails/167029/3 "2019-03-05T19:59:29Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
