strapi/docs/.vuepress/dist/assets/js/43.03b496f2.js
2018-10-05 17:24:17 +02:00

1 line
5.3 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{196:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._m(5),t._v(" "),a("p",[t._v("By default Strapi provides a local email system. You might want to send email with Sendgrid or another provider.")]),t._v(" "),a("p",[t._v("To install a new provider run:")]),t._v(" "),t._m(6),t._m(7),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("Check all community providers available on npmjs.org - "),a("a",{attrs:{href:"https://www.npmjs.com/search?q=strapi-email-",target:"_blank",rel:"noopener noreferrer"}},[t._v("Providers list"),a("OutboundLink")],1)])])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"email"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#email","aria-hidden":"true"}},[this._v("#")]),this._v(" Email")])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"warning custom-block"},[s("p",{staticClass:"custom-block-title"},[this._v("WARNING")]),this._v(" "),s("p",[this._v("This feature requires the Email plugin (installed by default).")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("Thanks to the plugin "),s("code",[this._v("Email")]),this._v(", you can send email on your server or externals providers such as Sendgrid.")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"usage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#usage","aria-hidden":"true"}},[this._v("#")]),this._v(" Usage")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{attrs:{class:"token keyword"}},[t._v("await")]),t._v(" strapi"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("plugins"),a("span",{attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{attrs:{class:"token string"}},[t._v("'email'")]),a("span",{attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("services"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("email"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("send")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n to"),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v("'admin@strapi.io'")]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{attrs:{class:"token keyword"}},[t._v("from")]),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v("'robbot@strapi.io'")]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n replyTo"),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v("'no-reply@strapi.io'")]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n subject"),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v("'Use strapi email provider successfully'")]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n text"),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v("'Hello world!'")]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n html"),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v("'Hello world!'")]),t._v("\n"),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"install-providers"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#install-providers","aria-hidden":"true"}},[this._v("#")]),this._v(" Install providers")])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("$ npm install strapi-email-sendgrid@alpha --save\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("We have two providers available "),s("code",[this._v("strapi-email-sendgrid")]),this._v(" and "),s("code",[this._v("strapi-upload-mailgun")]),this._v(", use the alpha tag to install one of them. Then, visit "),s("code",[this._v("/admin/plugins/email/configurations/development")]),this._v(" on your web browser and configure the provider.")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("If you want to create your own, make sure the name starts with "),s("code",[this._v("strapi-email-")]),this._v(" (duplicating an existing one will be easier to create), modify the "),s("code",[this._v("auth")]),this._v(" config object and customize the "),s("code",[this._v("send")]),this._v(" functions.")])}],!1,null,null,null);e.options.__file="email.md";s.default=e.exports}}]);