# Send custom email from plugin

**URL:** <https://meta.discourse.org/t/send-custom-email-from-plugin/81327>\
**Category:** Development\
**Created:** [23.Февраль.2018 17:29:58 UTC](https://meta.discourse.org/t/send-custom-email-from-plugin/81327 "2018-02-23T17:29:58Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [24.Февраль.2018 20:41:00 UTC](https://meta.discourse.org/t/send-custom-email-from-plugin/81327/3 "2018-02-24T20:41:00Z")

</div>

First of all, you should probably send the email in a sidekiq job. I’d start by trying doing something like this within your plugin:

> <https://github.com/discourse/discourse/blob/main/app/jobs/regular/admin_confirmation_email.rb#L16-L17>

> <https://github.com/discourse/discourse/blob/main/app/mailers/admin_confirmation_mailer.rb>

So, essentially, try to reuse the `build_email` method. It should create a message that works. You can add the `template` to your plugin’s locale file.

I hope that helps a little bit. I’m sure you can figure out the rest… 😉

---

_[View the full topic](https://meta.discourse.org/t/send-custom-email-from-plugin/81327)._
