{"id":5320,"date":"2022-10-17T09:23:29","date_gmt":"2022-10-17T13:23:29","guid":{"rendered":"https:\/\/www.cloudsurph.com\/?p=5320"},"modified":"2022-10-18T09:24:02","modified_gmt":"2022-10-18T13:24:02","slug":"how-to-manage-mailer-module-of-adonisjs","status":"publish","type":"post","link":"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/","title":{"rendered":"AdonisJS: Sending Emails"},"content":{"rendered":"<p>In this article, we can try to Define the AdonisJS Mailer Module, How to Manage the Mailer module of AdonisJS, Config Mailer module, configure new mailers and Usage, defer email sending Email templates, Use MJML to create your template.<\/p>\n<h3>Mailer<\/h3>\n<p>If you follow this article you can send emails from your application using the Mailer module of AdonisJS. Because it\u2019s built on top of a <a href=\"https:\/\/nodemailer.com\/about\/\">nodemailer<\/a> with a few additions like previewing emails and the ability to trap emails during tests.<\/p>\n<p>Before you can start sending emails, you need to make sure to install and configure the package using the following instructions or steps.<\/p>\n<h5>Install<\/h5>\n<p><strong><em>You can check our previous article:\u00a0<a href=\"https:\/\/www.cloudsurph.com\/adonisjs-rest-api-crud-setup\/\">AdonisJS: REST API simple CRUD Operation<\/a>. IF you want then buy a good, reliable, secure web\u00a0<a href=\"https:\/\/www.cloudsurph.com\/windows-vps-hosting\/\">hosting<\/a>\u00a0service \u00a0from here:\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">click here<\/a><\/em><\/strong><\/p>\n<pre class=\"prettyprint\">\r\nnpm i @adonisjs\/mail\r\n<\/pre>\n<h5>Configure<\/h5>\n<pre class=\"prettyprint\">\r\nnode ace configure @adonisjs\/mail\r\n# CREATE: config\/mail.ts\r\n# CREATE: contracts\/mail.ts\r\n# UPDATE: .env,.env.example\r\n# UPDATE: tsconfig.json { types += \"@adonisjs\/mail\" }\r\n# UPDATE: .adonisrc.json { commands += \"@adonisjs\/mail\/build\/commands\" }\r\n# UPDATE: .adonisrc.json { providers += \"@adonisjs\/mail\" }\r\n<\/pre>\n<h5>Validate environment variables<\/h5>\n<pre class=\"prettyprint\">\r\n\/**\r\n* Depending upon the mail driver you are using, you must validate\r\n* the environment variables required by it.\r\n*\r\n* Following is an example with Mailgun\r\n*\/\r\nexport default Env.rules({\r\nMAILGUN_API_KEY: Env.schema.string(),\r\nMAILGUN_DOMAIN: Env.schema.string(),\r\n})\r\n<\/pre>\n<h3>Config<\/h3>\n<p>Now, see the configuration for the mail package is stored inside the <strong>config\/mail.ts<\/strong> file. Inside this file, you can define multiple mailers using the same or different drivers if you want.<\/p>\n<h5><em><strong>You can purchase your\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">hosting from Cloudsurph.com<\/a>,\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">Cloudsurph hosting<\/a>\u00a0is a reliable hosting option for business and personal projects. We offer insight and help on system configuration issues and code errors or bugs<\/strong>.<\/em><\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5322\" src=\"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/AdonisJS-Sending-emails-Cloudsurph.jpg\" alt=\"\" width=\"1366\" height=\"756\" srcset=\"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/AdonisJS-Sending-emails-Cloudsurph.jpg 1366w, https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/AdonisJS-Sending-emails-Cloudsurph-1280x708.jpg 1280w, https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/AdonisJS-Sending-emails-Cloudsurph-980x542.jpg 980w, https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/AdonisJS-Sending-emails-Cloudsurph-480x266.jpg 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) and (max-width: 1280px) 1280px, (min-width: 1281px) 1366px, 100vw\" \/><\/p>\n<pre class=\"prettyprint\">\r\nimport { mailConfig } from '@adonisjs\/mail\/build\/config'\r\nexport default mailConfig({\r\nmailer: 'mailgun',\r\nmailers: {\r\nmailgun: {\r\ndriver: 'mailgun',\r\nbaseUrl: 'https:\/\/api.mailgun.net\/v3',\r\nkey: Env.get('MAILGUN_API_KEY'),\r\ndomain: Env.get('MAILGUN_DOMAIN'),\r\n},\r\nsmtp: {\r\ndriver: 'smtp',\r\nhost: Env.get('SMTP_HOST') as string,\r\nport: Env.get('SMTP_PORT') as string,\r\n},\r\n},\r\n})\r\n<\/pre>\n<p>So, you can pass all of the options except <strong>oDkim<\/strong> during the <strong>Mail.send<\/strong> call as well.<\/p>\n<pre class=\"prettyprint\">\r\nawait Mail.use('mailgun').send((message) =&gt; {\r\nmessage.subject('Welcome Onboard!')\r\n}, {\r\noTags: ['signup'],\r\n})\r\n<\/pre>\n<p>Also, you can define all configuration options at runtime during the <strong>Mail.send<\/strong> call.<\/p>\n<pre class=\"prettyprint\">\r\nawait Mail.use('sparkpost').send((message) =&gt; {\r\nmessage.subject('Welcome Onboard!')\r\n}, {\r\ntransaction: true,\r\nopenTracking: false,\r\n})\r\n<\/pre>\n<h4>Smtp auth options<\/h4>\n<p>Here, you can define the authentication options for the SMTP connections following the below command:<\/p>\n<pre class=\"prettyprint\">\r\n{\r\nsmtp: {\r\ndriver: 'smtp',\r\nauth: {\r\ntype: 'login'\r\nuser: 'username'\r\npass: 'password'\r\n}\r\n}\r\n}\r\n\r\n\/\/ Using Oauth2\r\n{\r\nsmtp: {\r\ndriver: 'smtp',\r\nauth: {\r\ntype: 'OAuth2',\r\nuser: 'username',\r\nclientId: 'clientId',\r\nclientSecret: 'clientSecret',\r\nrefreshToken?: 'refreshToken',\r\naccessToken?: 'accessToken',\r\nexpires?: 3600,\r\naccessUrl?: 'accessUrl'\r\n}\r\n}\r\n}\r\n<\/pre>\n<h4>Configuring new mailers<\/h4>\n<p>Do configure new mailers after the initial setup and use the <a href=\"https:\/\/github.com\/adonisjs\/mail\/blob\/develop\/templates\/config.txt\">config stub<\/a> as a reference to copy the default options for all the drivers.<\/p>\n<p>You must define the mailers inside the c<strong>ontracts\/mail.ts<\/strong> file before you can define its config or use it to send emails also. The contracts file is a way to inform the TypeScript static compiler about the existence of the mailer module.<\/p>\n<pre class=\"prettyprint\">\r\ndeclare module '@ioc:Adonis\/Addons\/Mail' {\r\nimport { MailDrivers } from '@ioc:Adonis\/Addons\/Mail'\r\n\r\ninterface MailersList {\r\nsmtp: MailDrivers['smtp'],\r\nses: MailDrivers['ses'],\r\nmailgun: MailDrivers['mailgun'],\r\nsparkpost: MailDrivers['sparkpost'],\r\n}\r\n}\r\n<\/pre>\n<p>In the <strong>MailersList<\/strong> interface are a key-value pair of the mailer name and the driver it uses and key can be anything. For example, like below<\/p>\n<pre class=\"prettyprint\">\r\ninterface MailersList {\r\ntransactional: MailDrivers['mailgun'],\r\nnewsletter: MailDrivers['sparkpost'],\r\n}\r\n<\/pre>\n<h4>Usage<\/h4>\n<p>However, once done with the setup, you can import the Mail module and send emails using the <strong>Mail.send<\/strong> method. And then it accepts a callback function to let you configure the outgoing message.<\/p>\n<pre class=\"prettyprint\">\r\nimport Mail from '@ioc:Adonis\/Addons\/Mail'\r\n\r\nclass UsersController {\r\npublic async store() {\r\nawait Mail.send((message) =&gt; {\r\nmessage\r\n.from('info@example.com')\r\n.to('virk@adonisjs.com')\r\n.subject('Welcome Onboard!')\r\n.htmlView('emails\/welcome', { name: 'Virk' })\r\n})\r\n}\r\n}\r\n<\/pre>\n<h4>Defer email sending<\/h4>\n<p>Now, you can make use of the <strong>Mail.sendLater<\/strong> method to push the email to an in-memory queue.<\/p>\n<pre class=\"prettyprint\">\r\nclass UsersController {\r\npublic async store() {\r\n\/\/ Pushed to in-memory queue\r\nawait Mail.sendLater((message) =&gt; {\r\nmessage\r\n.from('info@example.com')\r\n.to('virk@adonisjs.com')\r\n.subject('Welcome Onboard!')\r\n.htmlView('emails\/welcome', { name: 'Virk' })\r\n})\r\n}\r\n}\r\n<\/pre>\n<h4>Email templates<\/h4>\n<p>So, you can make use of standard Edge templates for defining the email content. The templates live inside the same resources\/view directory. For better organization, you can move them inside a sub-directory called emails like the below example:<\/p>\n<pre class=\"prettyprint\">\r\nnode ace make:view emails\/welcome\r\n\r\n# \u2714 create resources\/views\/emails\/welcome.edge\r\n<\/pre>\n<p>Now, created a new template file and paste the following contents inside it.<\/p>\n<pre class=\"prettyprint\">\r\n&lt;h1&gt; Welcome {{ user.fullName }} &lt;\/h1&gt;\r\n&lt;p&gt;\r\n&lt;a href=\"{{ url }}\"&gt;Click here&lt;\/a&gt; to verify your email address.\r\n&lt;\/p&gt;\r\n<\/pre>\n<p>Finally, you can reference the template as like below commands<\/p>\n<pre class=\"prettyprint\">\r\nawait Mail.sendLater((message) =&gt; {\r\nmessage.htmlView('emails\/welcome', {\r\nuser: { fullName: 'Some Name' },\r\nurl: 'https:\/\/your-app.com\/verification-url',\r\n})\r\n})\r\n<\/pre>\n<h6><em><strong>If you want to know more about AdonisJS Model relationships then please visit\u00a0<a href=\"https:\/\/preview.adonisjs.com\/guides\/model-relations\/introduction\">AdonisJs<\/a>\u00a0main website.<\/strong><\/em><\/h6>\n<p>If you enjoyed reading this article and have more questions please reach out to our\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/submitticket.php?step=2&amp;deptid=1\">support team<\/a>\u00a0via live chat or\u00a0<a href=\"mailto:support@cloudsurph.com\">email<\/a>\u00a0and we would be glad to help you. we provide server\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">hosting<\/a>\u00a0for all types of need and we can even get your\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">server<\/a>\u00a0up and running with the service of your choice.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we can try to Define the AdonisJS Mailer Module, How to Manage the Mailer module of AdonisJS, Config Mailer module, configure new mailers and Usage, defer email sending Email templates, Use MJML to create your template. Mailer If you follow this article you can send emails from your application using the Mailer [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":5321,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[152,157,25,158,159,44,1],"tags":[54,47,105,103,48,113],"class_list":["post-5320","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-adonisjs","category-centos-7","category-web-hosting-virtualization","category-linux-basics","category-linux-server","category-kvm-xen","category-virtual-private-servers","tag-best-vps-hosting-server-maryland","tag-cheap-cloud-servers","tag-cheap-storage-server-hosting","tag-cheapest-vps","tag-dedicated-server-hosting-in-washington-d-c","tag-speed-test-vps"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Manage Mailer module of AdonisJS<\/title>\n<meta name=\"description\" content=\"Config Mailer module, Configure new mailers and Usage, Defer email sending Email templates, Using MJML to create your template, Mailer Module\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Manage Mailer module of AdonisJS\" \/>\n<meta property=\"og:description\" content=\"Config Mailer module, Configure new mailers and Usage, Defer email sending Email templates, Using MJML to create your template, Mailer Module\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudsurph Web Hosting Washington D.C.\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/CloudSurph\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-17T13:23:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-18T13:24:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/How-to-Manage-Mailer-module-of-AdonisJS.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1264\" \/>\n\t<meta property=\"og:image:height\" content=\"760\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Rony\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cloudsurph\" \/>\n<meta name=\"twitter:site\" content=\"@Cloud_Surph\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rony\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-manage-mailer-module-of-adonisjs\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-manage-mailer-module-of-adonisjs\\\/\"},\"author\":{\"name\":\"Rony\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/person\\\/ac9b4dd136d96e50d5f29c560191e7ed\"},\"headline\":\"AdonisJS: Sending Emails\",\"datePublished\":\"2022-10-17T13:23:29+00:00\",\"dateModified\":\"2022-10-18T13:24:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-manage-mailer-module-of-adonisjs\\\/\"},\"wordCount\":546,\"publisher\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-manage-mailer-module-of-adonisjs\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/How-to-Manage-Mailer-module-of-AdonisJS.jpg\",\"keywords\":[\"Best VPS hosting server Maryland\",\"Cheap Cloud Servers\",\"Cheap Storage Server Hosting\",\"Cheapest VPS\",\"Dedicated Server Hosting in Washington D.C\",\"Speed test VPS\"],\"articleSection\":[\"AdonisJS\",\"CentOS 7\",\"Cloud Hosting\",\"Linux Basics\",\"Linux Server\",\"Virtualization\",\"VPS Servers\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-manage-mailer-module-of-adonisjs\\\/\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-manage-mailer-module-of-adonisjs\\\/\",\"name\":\"How to Manage Mailer module of AdonisJS\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-manage-mailer-module-of-adonisjs\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-manage-mailer-module-of-adonisjs\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/How-to-Manage-Mailer-module-of-AdonisJS.jpg\",\"datePublished\":\"2022-10-17T13:23:29+00:00\",\"dateModified\":\"2022-10-18T13:24:02+00:00\",\"description\":\"Config Mailer module, Configure new mailers and Usage, Defer email sending Email templates, Using MJML to create your template, Mailer Module\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-manage-mailer-module-of-adonisjs\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-manage-mailer-module-of-adonisjs\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-manage-mailer-module-of-adonisjs\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/How-to-Manage-Mailer-module-of-AdonisJS.jpg\",\"contentUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/How-to-Manage-Mailer-module-of-AdonisJS.jpg\",\"width\":1264,\"height\":760},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-manage-mailer-module-of-adonisjs\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.cloudsurph.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AdonisJS: Sending Emails\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#website\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/\",\"name\":\"Cloudsurph Web Hosting Washington D.C.\",\"description\":\"Dedicated Server Hosting\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.cloudsurph.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\",\"name\":\"CloudSurph Technology Solutions\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/cloudsurph-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/cloudsurph-logo.png\",\"width\":2348,\"height\":1692,\"caption\":\"CloudSurph Technology Solutions\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/CloudSurph\\\/\",\"https:\\\/\\\/x.com\\\/Cloud_Surph\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/person\\\/ac9b4dd136d96e50d5f29c560191e7ed\",\"name\":\"Rony\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"caption\":\"Rony\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/cloudsurph\"],\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/author\\\/ron\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Manage Mailer module of AdonisJS","description":"Config Mailer module, Configure new mailers and Usage, Defer email sending Email templates, Using MJML to create your template, Mailer Module","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/","og_locale":"en_US","og_type":"article","og_title":"How to Manage Mailer module of AdonisJS","og_description":"Config Mailer module, Configure new mailers and Usage, Defer email sending Email templates, Using MJML to create your template, Mailer Module","og_url":"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/","og_site_name":"Cloudsurph Web Hosting Washington D.C.","article_publisher":"https:\/\/www.facebook.com\/CloudSurph\/","article_published_time":"2022-10-17T13:23:29+00:00","article_modified_time":"2022-10-18T13:24:02+00:00","og_image":[{"width":1264,"height":760,"url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/How-to-Manage-Mailer-module-of-AdonisJS.jpg","type":"image\/jpeg"}],"author":"Rony","twitter_card":"summary_large_image","twitter_creator":"@cloudsurph","twitter_site":"@Cloud_Surph","twitter_misc":{"Written by":"Rony","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/#article","isPartOf":{"@id":"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/"},"author":{"name":"Rony","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/person\/ac9b4dd136d96e50d5f29c560191e7ed"},"headline":"AdonisJS: Sending Emails","datePublished":"2022-10-17T13:23:29+00:00","dateModified":"2022-10-18T13:24:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/"},"wordCount":546,"publisher":{"@id":"https:\/\/www.cloudsurph.com\/#organization"},"image":{"@id":"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/#primaryimage"},"thumbnailUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/How-to-Manage-Mailer-module-of-AdonisJS.jpg","keywords":["Best VPS hosting server Maryland","Cheap Cloud Servers","Cheap Storage Server Hosting","Cheapest VPS","Dedicated Server Hosting in Washington D.C","Speed test VPS"],"articleSection":["AdonisJS","CentOS 7","Cloud Hosting","Linux Basics","Linux Server","Virtualization","VPS Servers"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/","url":"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/","name":"How to Manage Mailer module of AdonisJS","isPartOf":{"@id":"https:\/\/www.cloudsurph.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/#primaryimage"},"image":{"@id":"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/#primaryimage"},"thumbnailUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/How-to-Manage-Mailer-module-of-AdonisJS.jpg","datePublished":"2022-10-17T13:23:29+00:00","dateModified":"2022-10-18T13:24:02+00:00","description":"Config Mailer module, Configure new mailers and Usage, Defer email sending Email templates, Using MJML to create your template, Mailer Module","breadcrumb":{"@id":"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/#primaryimage","url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/How-to-Manage-Mailer-module-of-AdonisJS.jpg","contentUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/How-to-Manage-Mailer-module-of-AdonisJS.jpg","width":1264,"height":760},{"@type":"BreadcrumbList","@id":"https:\/\/www.cloudsurph.com\/how-to-manage-mailer-module-of-adonisjs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.cloudsurph.com\/"},{"@type":"ListItem","position":2,"name":"AdonisJS: Sending Emails"}]},{"@type":"WebSite","@id":"https:\/\/www.cloudsurph.com\/#website","url":"https:\/\/www.cloudsurph.com\/","name":"Cloudsurph Web Hosting Washington D.C.","description":"Dedicated Server Hosting","publisher":{"@id":"https:\/\/www.cloudsurph.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.cloudsurph.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.cloudsurph.com\/#organization","name":"CloudSurph Technology Solutions","url":"https:\/\/www.cloudsurph.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2016\/04\/cloudsurph-logo.png","contentUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2016\/04\/cloudsurph-logo.png","width":2348,"height":1692,"caption":"CloudSurph Technology Solutions"},"image":{"@id":"https:\/\/www.cloudsurph.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/CloudSurph\/","https:\/\/x.com\/Cloud_Surph"]},{"@type":"Person","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/person\/ac9b4dd136d96e50d5f29c560191e7ed","name":"Rony","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","caption":"Rony"},"sameAs":["https:\/\/x.com\/cloudsurph"],"url":"https:\/\/www.cloudsurph.com\/author\/ron\/"}]}},"_links":{"self":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/comments?post=5320"}],"version-history":[{"count":2,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5320\/revisions"}],"predecessor-version":[{"id":5324,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5320\/revisions\/5324"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/media\/5321"}],"wp:attachment":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/media?parent=5320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/categories?post=5320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/tags?post=5320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}