Transaction email are not sent Magento 2.3.1 + DigitalOcean server

#1

Hi Craig, hi community,

I thought that I sent this query yesterday, however, I can’t find it any were. If I did please accept my apology and delete the initial one.

Yesterday I tried to test my transactional emails but to my surprise, my Magento for some reasons don’t send them.

I checked Magento configurations under Store/Configuration/Sales/Sales Emails and my “Orders” are set to enabled, “asynchronous sending” is disabled.

In addition, I checked Stores > Configuration > Advance > System > Mailing Setting “Disable Email Communication” is set to No.

I changed my system.log the only message I found which relates to the email is:

main.ERROR: Unable to send mail: Unknown error [] []
main.INFO: Consumer "async.operations.all" skipped as required connection "amqp" is not configured. Unknown connection name amqp [] []

I use DigitalOcean server. Is it possible the server blocks email traffic?
I could of omit some configuration. Please advise in your spare time.

Please refer to the attached screenshot if needed.

Regards,
Pawel

0 Likes

#2

Good morning.

Unless you specifically configured your DO Server to act as a Mail Transfer Agent (MTA), then you won’t be able to send any emails from it. Remember, Droplets are essentially blank slates for you to mould to your doing. If everything came pre-installed then you’d get less mileage out of your server specifications.

Most people use the SMTP settings of their email provider (e.g. Gmail). I personally use Mandrill because it’s better suited to my projects.

If you still want to add a Mail Transfer Agent (MTA) to your server, then this guide should be the answer. I’ve not tried it myself.

0 Likes

#3

Hello Craig,

Hope you are enjoying the long weekend. As you suggested I used one of SMTP extensions and Magento sends my emails now except emails related to shipments.

I tired to generate and preview the shipment confirmation template, however, Magento shows only an empty page.

I don’t really understand the template content but when I removed the following entry from this row I could preview the email. Please refer to the attached screenshot.

Could you please give me a tip on how to fix the dispatch confirmation email. I don’t want to just delete things which I don’t understand.

Thank you.

Regards,
Pawel

0 Likes

#4

Hi @PawelP. I haven’t been well, so a bit of a wasted long weekend :frowning:

You didn’t attach an image.

Do you have the correct Shipment Template assigned under Stores > Configuration > Sales > Sales Emails > Shipment ?

Also, you don’t need to create any Email Templates unless you plan to change anything. The Default templates that get generated are embedded in the Magento code itself.

0 Likes

#5

Hi,

I don’t know how it happened that I didn’t attach the screenshot.
Please find attached bellow.

Magento config is OK but the template itself not. It is a default Magento template.
As I said when I remove the highlighted entry I can preview the email.

Can you give me a tip what are these highlighted entries for?
Thank you.

Pawel

0 Likes

#6
  • Is your goal to amend the original template?
  • What file are you editing in this screenshot?
0 Likes

#7

Hi,

I’m sorry I wasn’t clear in my previous message. It is Magento’s original new shipment email template but I moved it to notepad ++ and tried to understand it.

You see if I navigate to marketing/email templates/add new/select new shipment/ load it and then try to preview template there is no result. Only an empty page will be shown. If I use the original Magento new shipment template no email is sent.

I tried then to understand the email elements. Email header, footer, email intro, summary are correct but in the email information section something is not correct. When I delete the highlighted entry I can preview the email but guys from Magento added these entries there for a reason. I just don’t want to delete them without understanding what there are for.

Pawel

0 Likes

#8

Ok, gotcha. You confused me with the notepad++ screenshot. I thought you were trying to build a new one or something.

To answer your question from before, those highlighted snippets are placeholders for variables and blocks. I won’t pretend that I know the exact details, because I don’t.

So, normally the default Templates are called from these two locations. Perhaps there is something wrong with these files?:

vendor/magento/module-sales/view/frontend/email/shipment_new.html
vendor/magento/module-sales/view/frontend/email/shipment_new_guest.html

In case you need them, the templates are below if you want to create a new template in the backend to replace the broken ones.

New Shipment

New Shipment - Subject

{{trans "Your %store_name order has shipped" store_name=$store.getFrontendName()}}

New Shipment - Template Content

{{template config_path="design/email/header_template"}}

<table>
    <tr class="email-intro">
        <td>
            <p class="greeting">{{trans "%name," name=$order.getCustomerName()}}</p>
            <p>
                {{trans "Thank you for your order from %store_name." store_name=$store.getFrontendName()}}
                {{trans 'You can check the status of your order by <a href="%account_url">logging into your account</a>.' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}
                {{trans 'If you have questions about your order, you can email us at <a href="mailto:%store_email">%store_email</a>' store_email=$store_email |raw}}{{depend store_phone}} {{trans 'or call us at <a href="tel:%store_phone">%store_phone</a>' store_phone=$store_phone |raw}}{{/depend}}.
                {{depend store_hours}}
                    {{trans 'Our hours are <span class="no-link">%store_hours</span>.' store_hours=$store_hours |raw}}
                {{/depend}}
            </p>
        </td>
    </tr>
    <tr class="email-summary">
        <td>
            <p>{{trans "Your shipping confirmation is below. Thank you again for your business."}}</p>

            <h1>{{trans "Your Shipment #%shipment_id for Order #%order_id" shipment_id=$shipment.increment_id order_id=$order.increment_id}}</h1>
        </td>
    </tr>
    <tr class="email-information">
        <td>
            {{depend comment}}
            <table class="message-info">
                <tr>
                    <td>
                        {{var comment|escape|nl2br}}
                    </td>
                </tr>
            </table>
            {{/depend}}
            {{block class='Magento\\Framework\\View\\Element\\Template' area='frontend' template='Magento_Sales::email/shipment/track.phtml' shipment=$shipment order=$order}}
            <table class="order-details">
                <tr>
                    <td class="address-details">
                        <h3>{{trans "Billing Info"}}</h3>
                        <p>{{var formattedBillingAddress|raw}}</p>
                    </td>
                    {{depend order.getIsNotVirtual()}}
                    <td class="address-details">
                        <h3>{{trans "Shipping Info"}}</h3>
                        <p>{{var formattedShippingAddress|raw}}</p>
                    </td>
                    {{/depend}}
                </tr>
                <tr>
                    <td class="method-info">
                        <h3>{{trans "Payment Method"}}</h3>
                        {{var payment_html|raw}}
                    </td>
                    {{depend order.getIsNotVirtual()}}
                    <td class="method-info">
                        <h3>{{trans "Shipping Method"}}</h3>
                        <p>{{var order.getShippingDescription()}}</p>
                    </td>
                    {{/depend}}
                </tr>
            </table>
            {{layout handle="sales_email_order_shipment_items" shipment=$shipment order=$order}}
        </td>
    </tr>
</table>

{{template config_path="design/email/footer_template"}}

New Shipment (Guest)

New Shipment (Guest) - Subject

{{trans "Your %store_name order has shipped" store_name=$store.getFrontendName()}}

New Shipment (Guest) - Template Content

{{template config_path="design/email/header_template"}}

<table>
    <tr class="email-intro">
        <td>
            <p class="greeting">{{trans "%name," name=$billing.getName()}}</p>
            <p>
                {{trans "Thank you for your order from %store_name." store_name=$store.getFrontendName()}}
                {{trans 'If you have questions about your order, you can email us at <a href="mailto:%store_email">%store_email</a>' store_email=$store_email |raw}}{{depend store_phone}} {{trans 'or call us at <a href="tel:%store_phone">%store_phone</a>' store_phone=$store_phone |raw}}{{/depend}}.
                {{depend store_hours}}
                    {{trans 'Our hours are <span class="no-link">%store_hours</span>.' store_hours=$store_hours |raw}}
                {{/depend}}
            </p>
        </td>
    </tr>
    <tr class="email-summary">
        <td>
            <p>{{trans "Your shipping confirmation is below. Thank you again for your business."}}</p>

            <h1>{{trans "Your Shipment #%shipment_id for Order #%order_id" shipment_id=$shipment.increment_id order_id=$order.increment_id}}</h1>
        </td>
    </tr>
    <tr class="email-information">
        <td>
            {{depend comment}}
            <table class="message-info">
                <tr>
                    <td>
                        {{var comment|escape|nl2br}}
                    </td>
                </tr>
            </table>
            {{/depend}}
            {{block class='Magento\\Framework\\View\\Element\\Template' area='frontend' template='Magento_Sales::email/shipment/track.phtml' shipment=$shipment order=$order}}
            <table class="order-details">
                <tr>
                    <td class="address-details">
                        <h3>{{trans "Billing Info"}}</h3>
                        <p>{{var formattedBillingAddress|raw}}</p>
                    </td>
                    {{depend order.getIsNotVirtual()}}
                    <td class="address-details">
                        <h3>{{trans "Shipping Info"}}</h3>
                        <p>{{var formattedShippingAddress|raw}}</p>
                    </td>
                    {{/depend}}
                </tr>
                <tr>
                    <td class="method-info">
                        <h3>{{trans "Payment Method"}}</h3>
                        {{var payment_html|raw}}
                    </td>
                    {{depend order.getIsNotVirtual()}}
                    <td class="method-info">
                        <h3>{{trans "Shipping Method"}}</h3>
                        <p>{{var order.getShippingDescription()}}</p>
                    </td>
                    {{/depend}}
                </tr>
            </table>
            {{layout handle="sales_email_order_shipment_items" shipment=$shipment order=$order}}
        </td>
    </tr>
</table>

{{template config_path="design/email/footer_template"}}
0 Likes

#9

Hi Craig,

I tired these but I still can’t preview them. Can you preview on your M install?

I even reverse my Magento to the initial install to make sure that no customisation or module is braking the template.

Pawel

0 Likes

#10

As a matter of fact… No, I cannot. My Sandbox is running 2.3.1. Potentially, you’ve discovered a core bug. I’ll look into it more later and submit a detailed bug report to Magento.

Well spotted. See, it’s not always something you’ve done yourself :slight_smile:

EDIT: It’s something to do with this line. When I remove it, the template generates:

{{block class='Magento\\Framework\\View\\Element\\Template' area='frontend' template='Magento_Sales::email/shipment/track.phtml' shipment=$shipment order=$order}}

EDIT 2: I’ve submitted an official bug report with Magento. It normally takes a while for the actual issue to get resolved.

0 Likes

#11

Hi,
Thank you.

I still have some time before I launch the site on M2.3.1 and l am waiting for M2E Pro to be compatible with the newest M version but in the mean time trying to configure whatever I can.

I try to follow your posts and in one of it I spotted that you have both Ultimo and Porto themes. I also have both , however, I can’t successfully install Porto on M2.3.1.

Maybe when you find some time you’ll record a tutorial about it :slight_smile:

If you won’t forget please ping me a message when Magento guys give you an update on the New shipment template. Thank you.

Pawel

0 Likes

#12

I’m only currently running Porto on a 2.2.8 Production Server. I’ve not tried either theme with 2.3.x. All of sandbox servers are simply running Luma. So, I’ve not tested those yet.

I was really torn whether to cover a video on installing a theme. The issue with covering topics like this are:

  • When something goes wrong, people turn to me for the answer rather then the Devs
  • I used to have an affiliate link with Themeforest (envato) but then they removed the program
  • The content can go out of date quite quickly
  • Creating a video like this takes a lot of time. Time is my most valuable asset. And I don’t feel like I want to be promoting someone else’s product when I have nothing to benefit.

So, rather than promise that I will cover this I would rather be honest and say I probably won’t. However, when I come to test Porto on 2.3.1 and run into any issues, then I’ll be sure to document them on the forum.

To stay updated on the GitHub Issue, just load the page I linked to and hit “Subscribe”. You’ll get emailed whenever there’s an update.

0 Likes

#13

Hi,
Ref Porto I understand. In addition their documentation isn’t great.

I’ll try again and see.

Have a good day.

Pawel

1 Like