{"id":3143,"date":"2020-10-27T17:06:45","date_gmt":"2020-10-27T16:06:45","guid":{"rendered":"https:\/\/www.spinat.fr\/?p=3143"},"modified":"2020-10-27T17:09:53","modified_gmt":"2020-10-27T16:09:53","slug":"prestashop-envoyer-les-emails-depuis-sendgrid-smtp","status":"publish","type":"post","link":"https:\/\/www.spinat.fr\/en\/prestashop-envoyer-les-emails-depuis-sendgrid-smtp\/","title":{"rendered":"Prestashop : Send emails from SendGrid SMTP"},"content":{"rendered":"<p><strong>Why not use SendGrid to route all emails from your Prestashop site? <\/strong><\/p>\n<p>Email deliverability is a very important thing for any website. For an e-commerce website, it is important that customers can receive their order confirmation or account creation emails.<\/p>\n<p>Prestashop uses by default the mail() function of PHP for email routing. It works, but there is no guarantee that it will arrive in the recipient\u2019s mailbox, especially if you are on a shared hosting.<\/p>\n<p>There is no ready-made module for this, and I searched for a few minutes to reach my goal. So here is a guide to get SendGrid working with Prestashop.<\/p>\n<h2>1 \u2013 Generate an API key on SendGrid for Prestashop<\/h2>\n<p><img decoding=\"async\" class=\"wp-image-3132 alignright\" src=\"https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid1.jpg\" alt=\"SendGrid API Prestashop\" width=\"142\" height=\"160\" srcset=\"https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid1.jpg 354w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid1-266x300.jpg 266w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid1-150x169.jpg 150w\" sizes=\"(max-width: 142px) 100vw, 142px\" title=\"\"> Log in to your SendGrid account and go to <em>Settings &gt; API Key<\/em><\/p>\n<p>Then click on \u201cCreate API Key\u201d in the top right corner of your screen, define an API name, and give all the rights <em>(Full Access<\/em>) <img decoding=\"async\" class=\"aligncenter size-large wp-image-3130\" src=\"https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid2-1024x716.jpg\" alt=\"\" width=\"1024\" height=\"716\" srcset=\"https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid2-1024x716.jpg 1024w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid2-300x210.jpg 300w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid2-768x537.jpg 768w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid2-1536x1074.jpg 1536w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid2-980x685.jpg 980w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid2-150x105.jpg 150w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid2.jpg 1834w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"\"> Copy and paste the key that appears on the screen somewhere, it will serve us right after.<\/p>\n<h2>2 \u2013 Configuring SendGrid on Prestashop<\/h2>\n<ul>\n<li>Go to your Prestashop backoffice and go to<em>\u201cAdvanced Settings &gt; Emails\u201d<\/em><\/li>\n<li>Select<em>\u201cUse my own SMTP settings (for experts only)<\/em>\u201c<\/li>\n<li>Fill in the following information :\n<ul>\n<li><strong><label class=\"form-control-label \">Email domain name<\/label> <\/strong>Leave blank<\/li>\n<li><strong>IP or server name<\/strong>: <em>smtp.sendgrid.net<\/em><\/li>\n<li><strong>SMTP user<\/strong>: <em>apikey<\/em> (it\u2019s the same user for everyone)<\/li>\n<li><strong>SMTP Password<\/strong>: {your previous API key created}<\/li>\n<li><strong>Encryption<\/strong>: SSL<\/li>\n<li><strong>Port<\/strong>: 465<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-3134\" src=\"https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid3-1024x562.jpg\" alt=\"Prestashop &amp; SendGrid\" width=\"1024\" height=\"562\" srcset=\"https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid3-1024x562.jpg 1024w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid3-300x165.jpg 300w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid3-768x421.jpg 768w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid3-1536x842.jpg 1536w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid3-2048x1123.jpg 2048w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid3-980x537.jpg 980w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/sendgrid3-150x82.jpg 150w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"\"><\/p>\n<h2>3 \u2013 Make a test of sending email<\/h2>\n<p>Enter your email in the test field at the bottom of the screen. You should get a confirmation message if everything went well. <img decoding=\"async\" class=\"aligncenter size-large wp-image-3136\" src=\"https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/confirmation-sendgrid-1024x325.jpg\" alt=\"\" width=\"1024\" height=\"325\" srcset=\"https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/confirmation-sendgrid-1024x325.jpg 1024w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/confirmation-sendgrid-300x95.jpg 300w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/confirmation-sendgrid-768x244.jpg 768w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/confirmation-sendgrid-1536x487.jpg 1536w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/confirmation-sendgrid-2048x649.jpg 2048w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/confirmation-sendgrid-980x311.jpg 980w, https:\/\/www.spinat.fr\/wp-content\/uploads\/2020\/10\/confirmation-sendgrid-150x48.jpg 150w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"\"><\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>Why not use SendGrid to route all emails from your Prestashop site? Email deliverability is a very important thing for any website. For an e-commerce&hellip;<\/p>\n","protected":false},"author":1,"featured_media":3140,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[106,111],"tags":[],"_links":{"self":[{"href":"https:\/\/www.spinat.fr\/en\/wp-json\/wp\/v2\/posts\/3143"}],"collection":[{"href":"https:\/\/www.spinat.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.spinat.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.spinat.fr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.spinat.fr\/en\/wp-json\/wp\/v2\/comments?post=3143"}],"version-history":[{"count":4,"href":"https:\/\/www.spinat.fr\/en\/wp-json\/wp\/v2\/posts\/3143\/revisions"}],"predecessor-version":[{"id":3147,"href":"https:\/\/www.spinat.fr\/en\/wp-json\/wp\/v2\/posts\/3143\/revisions\/3147"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.spinat.fr\/en\/wp-json\/wp\/v2\/media\/3140"}],"wp:attachment":[{"href":"https:\/\/www.spinat.fr\/en\/wp-json\/wp\/v2\/media?parent=3143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spinat.fr\/en\/wp-json\/wp\/v2\/categories?post=3143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spinat.fr\/en\/wp-json\/wp\/v2\/tags?post=3143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}