<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title><![CDATA[MageryThemes Blog - Magento 2 Extensions and Themes]]></title>
    <link>https://magery-themes.com/blog/</link>
    <description><![CDATA[MageryThemes Blog - Magento 2 Extensions and Themes]]></description>
    <pubDate>Tue, 23 Jun 2026 10:10:27 +0000</pubDate>
    <generator>Zend_Feed</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <item>
      <title><![CDATA[Magento and SMTP]]></title>
      <link>https://magery-themes.com/blog/magento-smtp/</link>
      <description><![CDATA[<p>Magento is one of the most popular open-source e-commerce platforms available today. It is known for its scalability, flexibility, and robustness. One of the critical aspects of any e-commerce platform is the ability to communicate with customers via email. Magento 2.4.6 has recently introduced SMTP support, making it easier to send emails through an external email server.</p>
<p>SMTP, or Simple Mail Transfer Protocol, is an email protocol used to transfer emails between email servers. Magento 2.4.6 now allows store owners to configure their SMTP settings and send emails using external email servers like Gmail, Yahoo, or any other email service provider. This means that store owners no longer need to rely on the default email server provided by their hosting company.</p>
<p>By using an external email server, store owners can take advantage of the advanced features offered by email service providers. These features include email templates, email tracking, and email analytics. Additionally, using an external email server can help improve email deliverability and reduce the chances of emails being marked as spam.</p>
<div class="flex-1 overflow-hidden">
<div class="react-scroll-to-bottom--css-znhle-79elbk h-full dark:bg-gray-800">
<div class="react-scroll-to-bottom--css-znhle-1n7m0yu">
<div class="flex flex-col items-center text-sm dark:bg-gray-800">
<div class="group w-full text-gray-800 dark:text-gray-100 border-b border-black/10 dark:border-gray-900/50 bg-gray-50 dark:bg-[#444654]">
<div class="text-base gap-4 md:gap-6 md:max-w-2xl lg:max-w-2xl xl:max-w-3xl p-4 md:py-6 flex lg:px-0 m-auto">
<div class="relative flex w-[calc(100%-50px)] flex-col gap-1 md:gap-3 lg:w-[calc(100%-115px)]">
<div class="flex flex-grow flex-col gap-3">
<div class="min-h-[20px] flex flex-col items-start gap-4 whitespace-pre-wrap">
<div class="markdown prose w-full break-words dark:prose-invert light">
<p>To configure SMTP in Magento 2.4.6, follow these steps:</p>
<ol>
<li>Login to your Magento 2.4.6 admin panel.</li>
<li>From the menu on the left, go to Stores &gt; Configuration.</li>
<li>In the Configuration panel, click on Advanced &gt; System.</li>
<li>In the SMTP configuration settings, set the following values:</li>
</ol>
<ul>
<li>Set "Enabled" to "Yes".</li>
<li>In the Host field, enter the SMTP host name.</li>
<li>In the Port field, enter the SMTP port number. (Usually 465 or 587)</li>
<li>In the Authentication field, choose the authentication method used by your email service provider.</li>
<li>In the Username field, enter the SMTP username.</li>
<li>In the Password field, enter the SMTP password.</li>
</ul>
<ol start="5">
<li>Click on "Test Email" to ensure that the SMTP settings are working correctly.</li>
<li>Save the configuration by clicking on the "Save Config" button.</li>
</ol>
<p>By following these steps, you should now have successfully configured SMTP in Magento 2.4.6. You can now send emails using your external email server.</p>
<p>If you need to get the full control over your email notifications in Magento you can use our module that allows to <a href="https://magery-themes.com/disable-email-notifications-magento2.html">disable a specific email notification</a>.</p>
</div>
</div>
</div>
<div class="flex justify-between">
<div class="text-gray-400 flex self-end lg:self-center justify-center mt-2 gap-3 md:gap-4 lg:gap-1 lg:absolute lg:top-0 lg:translate-x-full lg:right-0 lg:mt-0 lg:pl-2 visible"></div>
</div>
</div>
</div>
</div>
<div class="w-full h-32 md:h-48 flex-shrink-0"></div>
</div>
</div>
</div>
</div>
<div class="absolute bottom-0 left-0 w-full border-t md:border-t-0 dark:border-white/20 md:border-transparent md:dark:border-transparent md:bg-vert-light-gradient bg-white dark:bg-gray-800 md:!bg-transparent dark:md:bg-vert-dark-gradient pt-2"><form class="stretch mx-2 flex flex-row gap-3 last:mb-2 md:mx-4 md:last:mb-6 lg:mx-auto lg:max-w-3xl">
<div class="relative flex h-full flex-1 md:flex-col">
<div class="flex ml-1 md:w-full md:m-auto md:mb-2 gap-0 md:gap-2 justify-center"><button class="btn relative btn-neutral border-0 md:border"></button></div>
</div>
</form></div>
<div id="gtx-trans" style="position: absolute; left: 808px; top: 360.5px;">
<div class="gtx-trans-icon"></div>
</div>]]></description>
      <pubDate>Sun, 26 Mar 2023 08:39:34 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[How does Magento 2 send emails?]]></title>
      <link>https://magery-themes.com/blog/how-magento2-sends-emails/</link>
      <description><![CDATA[<p dir="ltr"><span>Email notifications are a crucial part of most websites, especially for eCommerce shops. Magento has a lot of different email notifications that deliver an important notification to a customer and store owner as well.</span></p>
<p dir="ltr"><span>I would like to go through all steps and see how Magento sends different emails from the technical point of view.</span></p>
<p>If you need to disable some email notifications in Magento 2, you can check <a href="https://magery-themes.com/disable-email-notifications-magento2.html" title="Disable emails for Magento 2">our extension</a>.</p>
<p dir="ltr"><span><span style="text-decoration: underline;">Note</span>: all code snippets were taken from the latest Magento Open Source 2.2.3 (community edition)</span></p>
<p><span>&nbsp;</span></p>
<h2><span>New customer account notification</span></h2>
<p>Let's explore one of the most popular email notifications - new customer account confirmation. Magento sends this type of notification when a user submits a registration form. We assume here that customer confirmation feature is disabled by default.</p>
<p>This type of email notifications is being sent immediately, without queueing.</p>
<p></p>
<p>Everything starts in the controller, account management model receives customer object with extracted data and password.</p>
<p><code class="language-php">vendor/magento/module-customer/Controller/Account/CreatePost.php</code></p>
<p></p>
<pre><code class="language-php">
$customer = $this-&gt;accountManagement
                -&gt;createAccount($customer, $password, $redirectUrl);
</code>
</pre>
<p></p>
<p><br /><br /></p>
<p>Account management (<code class="language-php">\Magento\Customer\Model\AccountManagement</code>) calls <em>createAccountWithPasswordHash</em> method inside <em>createAccount</em></p>
<p>Then a customer object is being saved using customer repository:</p>
<pre><code class="language-php">
$customer = $this-&gt;customerRepository-&gt;save($customer, $hash);
</code>
</pre>
<p><br /><br /></p>
<p>And after successful save it sends email notification:</p>
<pre><code class="language-php">
$this-&gt;sendEmailConfirmation($customer, $redirectUrl);
// ...
$this-&gt;getEmailNotification()-&gt;newAccount($customer, $templateType, $redirectUrl, $customer-&gt;getStoreId());
</code>
</pre>
<p></p>
<p><span style="text-decoration: underline;">Note</span>: <em>getEmailNotification()</em> method is deprecated now.</p>
<p></p>
<p></p>
<p>Here is how <code class="language-php">\Magento\Customer\Model\EmailNotification::newAccount()</code> looks like:</p>
<p></p>
<pre><code class="language-php">
public function newAccount(
    CustomerInterface $customer,
    $type = self::NEW_ACCOUNT_EMAIL_REGISTERED,
    $backUrl = '',
    $storeId = 0,
    $sendemailStoreId = null
) {
    $types = self::TEMPLATE_TYPES;

    if (!isset($types[$type])) {
        throw new LocalizedException(__('Please correct the transactional account email type.'));
    }

    if (!$storeId) {
        $storeId = $this-&gt;getWebsiteStoreId($customer, $sendemailStoreId);
    }

    $store = $this-&gt;storeManager-&gt;getStore($customer-&gt;getStoreId());

    $customerEmailData = $this-&gt;getFullCustomerObject($customer);

    $this-&gt;sendEmailTemplate(
        $customer,
        $types[$type],
        self::XML_PATH_REGISTER_EMAIL_IDENTITY,
        ['customer' =&gt; $customerEmailData, 'back_url' =&gt; $backUrl, 'store' =&gt; $store],
        $storeId
    );
}
</code>
</pre>
<p><br /><br /></p>
<p>Also, we have DotMailer plugin here <code class="language-php">\Dotdigitalgroup\Email\Plugin\CustomerEmailNotificationPlugin::aroundNewAccount()</code> which checks if email notification should be disabled depending on the configuration. But by default, DotMailer is disabled, so we are moving forward.</p>
<p></p>
<p>The next method is <code class="language-php">\Magento\Customer\Model\EmailNotification::sendEmailTemplate()</code></p>
<p></p>
<pre><code class="language-php">
private function sendEmailTemplate(
    $customer,
    $template,
    $sender,
    $templateParams = [],
    $storeId = null,
    $email = null
) {
    $templateId = $this-&gt;scopeConfig-&gt;getValue($template, 'store', $storeId);
    if ($email === null) {
        $email = $customer-&gt;getEmail();
    }
    $transport = $this-&gt;transportBuilder-&gt;setTemplateIdentifier($templateId)
        -&gt;setTemplateOptions(['area' =&gt; 'frontend', 'store' =&gt; $storeId])
        -&gt;setTemplateVars($templateParams)
        -&gt;setFrom($this-&gt;scopeConfig-&gt;getValue($sender, 'store', $storeId))
        -&gt;addTo($email, $this-&gt;customerViewHelper-&gt;getCustomerName($customer))
        -&gt;getTransport();

    $transport-&gt;sendMessage();
}
</code>
</pre>
<p><br /><br /></p>
<p>This method contains code that is used for most email notifications. Here we create a transport object which sends an email. Let&rsquo;s have a deeper look at how it works.</p>
<p>The main object for sending emails is <strong>\Magento\Framework\Mail\Template\TransportBuilder</strong> TransportBuilder requires the following data:</p>
<ul>
<li>Template identifier (template name or template numeric ID if a template is customized in admin)</li>
<li>Template Options: area (&ldquo;frontend&rdquo; or &ldquo;adminhtml&rdquo;) and store ID</li>
<li>Template variables (any data that will be used in email template)</li>
<li>Sender information (email identity from the configuration, for customer notifications it is &ldquo;general&rdquo;)</li>
<li>Receiver information (email and name)</li>
</ul>
<p><br /><br /></p>
<p>By default, TransportBuilder returns <strong>\Magento\Email\Model\Transport</strong> object instance. If you want, you can replace this transport object with your custom class using dependency injection (argument replacement) or simple class preference.</p>
<p>There are some plugins for sendMessage method:</p>
<ul>
<li><em>\Magento\Email\Model\Plugin\WindowsSmtpConfig::beforeSendMessage()</em> - sets SMTP port if Magento is running on Windows</li>
<li><em>\Magento\Email\Model\Mail\TransportInterfacePlugin::aroundSendMessage()</em> - checks if email communications is enabled</li>
<li><em>\Dotdigitalgroup\Email\Plugin\TransportPlugin::aroundSendMessage()</em></li>
</ul>
<p><br /><br /></p>
<p>After executing all these plugins, finally, Zend Mail component takes control over sending an email. This is the lowest layer and here it calls for PHP mail function:</p>
<ul>
<li>\Zend_Mail_Transport_Abstract::send()</li>
<li>\Zend_Mail_Transport_Sendmail::_sendMail()</li>
</ul>
<p><br /><br /></p>
<p>That's it. In the next article we will review another email notification.</p>]]></description>
      <pubDate>Sat, 14 Apr 2018 10:04:56 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Magento 2 - How to confirm customer account?]]></title>
      <link>https://magery-themes.com/blog/magento2-confirm-account/</link>
      <description><![CDATA[<p><span style="text-decoration: underline;"><strong>UPDATE</strong></span>: we created the module that allows you to <a href="https://magery-themes.com/confirm-customer-email-for-magento-2.html">confirm customer emails</a> from Magento admin.</p>
<p><br /><br /></p>
<p>Magento 2 gives us the ability to take more control of the customer account creation process. There is a special configuration setting located in admin under <em>Stores &rarr; Configuration &rarr; Customers &rarr; Customer Configuration &rarr; Create New Account Options</em> named&nbsp;<strong>Require Emails Confirmation</strong>&nbsp;(Yes/No)<br /><br /><img alt="Account confirmation setting" src="https://magery-themes.com/media/wysiwyg/require-account-confirmation.png" style="vertical-align: middle;" width="500" /><br /><br />If you set this setting to <strong><em>Yes</em></strong>, a customer will not be able to log in without account confirmation. He needs to click the activation link in account confirmation email.</p>
<p><img alt="Account confirmation is required" src="https://magery-themes.com/media/wysiwyg/admin-confirmation-required.png" style="vertical-align: middle;" width="500" /><br /><br />By the way, this email template is defined in <em>vendor/magento/module-customer/etc/email_templates.xml</em>&nbsp;<strong></strong>file:</p>
<pre class="language-xml"><code class="language-xml"><em>&lt;<span class="pl-ent">template</span>&nbsp;<span class="pl-e">id</span>=<span class="pl-s"><span class="pl-pds">"</span>customer_create_account_email_confirmation_template<span class="pl-pds">"</span></span>&nbsp;<span class="pl-e">label</span>=<span class="pl-s"><span class="pl-pds">"</span>New Account Confirmation Key<span class="pl-pds">"</span></span><span class="pl-e">file</span>=<span class="pl-s"><span class="pl-pds">"</span>account_new_confirmation.html<span class="pl-pds">"</span></span>&nbsp;<span class="pl-e">type</span>=<span class="pl-s"><span class="pl-pds">"</span>html<span class="pl-pds">"</span></span>&nbsp;<span class="pl-e">module</span>=<span class="pl-s"><span class="pl-pds">"</span>Magento_Customer<span class="pl-pds">"</span></span>&nbsp;<span class="pl-e">area</span>=<span class="pl-s"><span class="pl-pds">"</span>frontend<span class="pl-pds">"</span></span>/&gt;</em></code>
</pre>
<p><br />Unfortunately, there is no way to confirm user account from <strong>Magento 2</strong> admin area.<br />If you are a developer and you are doing some local testing (assuming you don't receive emails from your local installation) you can confirm a customer account via the database.<br />There is a field <em>`customer_entity`.`confirmation`</em> which contains activation hash code.</p>
<p></p>
<p><img alt="MySQL field" src="https://magery-themes.com/media/wysiwyg/db-field.png" style="vertical-align: middle;" width="500" /><br /><br /><br />All you need to do - is simply remove that hash value.<br />Here is SQL query that will help you to confirm customer by email:</p>
<pre class="language-sql"><code class="language-sql">
UPDATE customer_entity SET confirmation = NULL WHERE email='some.email@example.com';
</code></pre>
<p><br /><br /></p>
<h2>The easiest solution</h2>
<p>We created a special module that gives you the ability to <a href="https://magery-themes.com/confirm-customer-email-for-magento-2.html">confirm customer emails from Magento admin</a>.</p>]]></description>
      <pubDate>Wed, 25 Oct 2017 16:46:37 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[How to manage customer account links in Magento 2]]></title>
      <link>https://magery-themes.com/blog/customer-links-magento2/</link>
      <description><![CDATA[<p dir="ltr">By default, Magento 2 has long list of customer account. But sometimes not all links are needed. Often it&rsquo;s needed to remove, for example,&nbsp;<strong>My Credit Cards</strong>&nbsp;link or remove&nbsp;<strong>My Downloadable Products</strong>&nbsp;link.</p>
<p dir="ltr"></p>
<p></p>
<p dir="ltr">Here is the list of default links in customer account navigation:</p>
<ul>
<li>Account Dashboard</li>
<li>Account Information</li>
<li>Address Book</li>
<li>My Downloadable Products</li>
<li>My Orders</li>
<li>Newsletter Subscriptions</li>
<li>Stored Payment Methods</li>
<li>My Product Reviews</li>
<li>Billing Agreements</li>
<li>My Wish List</li>
</ul>
<p>&nbsp;</p>
<p dir="ltr">In Magento 2&nbsp;<strong>Enterprise Edition</strong>&nbsp;there are some additional links:</p>
<ul>
<li>Store Credit</li>
<li>Order by SKU</li>
<li>Gift Card</li>
<li>Gift Registry</li>
<li>Reward Points</li>
<li>My Invitations</li>
</ul>
<p>&nbsp;</p>
<p dir="ltr">In order to&nbsp;<strong>remove customer links</strong>&nbsp;in Magento 2 you need to create layout instructions to remove needed blocks.</p>
<p dir="ltr">For example,&nbsp;<strong>Billing Agreements</strong>&nbsp;link corresponds to the block with name&nbsp;<em>customer-account-navigation-billing-agreements-link</em></p>
<p dir="ltr">So, the resulting layout update will look like this:</p>
<p>&nbsp;</p>
<pre style="background: #042029; color: #839496;">&lt;?<span style="color: #268bd2; font-weight: bold;">xml</span><span style="color: #93a1a1;"> version</span>=<span style="color: #269186;"><span style="color: #c60000;">"</span>1.0<span style="color: #c60000;">"</span></span>?&gt;
&lt;<span style="color: #268bd2; font-weight: bold;">page</span> <span style="color: #93a1a1;">xmlns</span>:xsi=<span style="color: #269186;"><span style="color: #c60000;">"</span>http://www.w3.org/2001/XMLSchema-instance<span style="color: #c60000;">"</span></span> <span style="color: #93a1a1;">xsi</span>:noNamespaceSchemaLocation=<span style="color: #269186;"><span style="color: #c60000;">"</span>urn:magento:framework:View/Layout/etc/page_configuration.xsd<span style="color: #c60000;">"</span></span>&gt;
    &lt;<span style="color: #268bd2; font-weight: bold;">body</span>&gt;
        &lt;<span style="color: #268bd2; font-weight: bold;">referenceBlock</span> <span style="color: #93a1a1;">name</span>=<span style="color: #269186;"><span style="color: #c60000;">"</span>customer-account-navigation-billing-agreements-link<span style="color: #c60000;">"</span></span> <span style="color: #93a1a1;">remove</span>=<span style="color: #269186;"><span style="color: #c60000;">"</span>true<span style="color: #c60000;">"</span></span>/&gt;
    &lt;/<span style="color: #268bd2; font-weight: bold;">body</span>&gt;
&lt;/<span style="color: #268bd2; font-weight: bold;">page</span>&gt;
</pre>
<p dir="ltr"></p>
<p dir="ltr">It is also possible to&nbsp;<strong>change link title</strong>&nbsp;and&nbsp;<strong>reorder</strong>&nbsp;customer account links. For changing link text you need to call&nbsp;<em>setLabel</em>&nbsp;for the corresponding block. Reordering can be done using&nbsp;<em>reorderChild</em>&nbsp;method of layout.</p>
<h3 dir="ltr"></h3>
<p></p>
<p></p>
<h3 dir="ltr">Removing customer account links using extension</h3>
<p dir="ltr"></p>
<p></p>
<p dir="ltr">We created a simple and useful extension for Magento 2 that allows to manage customer account links from admin.</p>
<p dir="ltr">Key features of the module:</p>
<ul>
<li>Remove unnecessary links</li>
<li>Change link labels</li>
<li>Change position of the links</li>
<li>Compatible with&nbsp;<strong>Enterprise Edition</strong></li>
<li>Supports custom links added by 3rd-party extensions</li>
</ul>
<p><span id="docs-internal-guid-be08d6eb-3dc2-73b2-9935-05273008f15f"><br />You can check more details on the extension page&nbsp;<a href="https://magery-themes.com/magento-2-account-links-manager.html">https://magery-themes.com/magento-2-account-links-manager.html</a></span></p>]]></description>
      <pubDate>Wed, 05 Apr 2017 11:12:07 +0000</pubDate>
    </item>
  </channel>
</rss>
