magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.48k stars 9.29k forks source link

Email template variables not working #37546

Closed Naberdz closed 1 year ago

Naberdz commented 1 year ago

Preconditions and environment

Steps to reproduce

Create new order and check email.

Expected result

Expecting normal email with all data populated

Actual result

{{htmlescape var=$order.getCustomerName()}} remains as is {{var order.getCreatedAtFormated('long')}} has no value {{var order.getBillingAddress().format('html')}} has no value {{var order.getShippingAddress().format('html')}} has no value {{var payment_html.format('html')}} is not formated in html and gives tags as plain text

Schermafbeelding 2023-05-26 om 09 19 13

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 year ago

Hi @Naberdz. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

m2-assistant[bot] commented 1 year ago

Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Bravo commented 1 year ago

Hi @Naberdz,

Thank you for reporting and collaboration.

Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the attached video.

Steps to reproduce

We are getting normal emails and all fields are populated and working as expected.

https://github.com/magento/magento2/assets/51680745/9df376be-1a0f-41db-b4ba-0e0b0742543c

Kindly recheck the behaviour on Magento 2.4-develop instance and elaborate steps to reproduce if the issue is still reproducible.

Thanks.

Naberdz commented 1 year ago

Have disabled all module except for magento 2: result is still the same.

Magento_Store Magento_AdminAnalytics Magento_AdminNotification Magento_AdobeIms Magento_AdobeImsApi Magento_AdobeStockAdminUi Magento_MediaGallery Magento_AdobeStockAssetApi Magento_AdobeStockClient Magento_AdobeStockClientApi Magento_AdobeStockImage Magento_Directory Magento_AdobeStockImageApi Magento_AdvancedPricingImportExport Magento_Theme Magento_Amqp Magento_Config Magento_Backend Magento_Authorization Magento_Eav Magento_Customer Magento_User Magento_Backup Magento_Indexer Magento_GraphQl Magento_BundleImportExport Magento_CacheInvalidate Magento_Variable Magento_Cms Magento_Rule Magento_Security Magento_CmsGraphQl Magento_EavGraphQl Magento_Search Magento_CatalogImportExport Magento_Catalog Magento_CatalogInventory Magento_CatalogPageBuilderAnalytics Magento_CatalogRule Magento_Msrp Magento_CatalogRuleGraphQl Magento_CatalogSearch Magento_CatalogUrlRewrite Magento_StoreGraphQl Magento_MediaStorage Magento_Quote Magento_SalesSequence Magento_CheckoutAgreementsGraphQl Magento_MediaGalleryUi Magento_CatalogGraphQl Magento_CmsPageBuilderAnalytics Magento_CmsUrlRewrite Magento_CmsUrlRewriteGraphQl Magento_CompareListGraphQl Magento_Integration Magento_Payment Magento_Sales Magento_QuoteGraphQl Magento_Checkout Magento_Contact Magento_Cookie Magento_Cron Magento_Csp Magento_Widget Magento_Robots Magento_Analytics Magento_Downloadable Magento_CustomerGraphQl Magento_CustomerImportExport Magento_DataMigrationTool Magento_Deploy Magento_Developer Magento_Dhl Magento_AdvancedSearch Magento_DirectoryGraphQl Magento_DownloadableGraphQl Magento_CustomerDownloadableGraphQl Magento_ImportExport Magento_Bundle Magento_CatalogCustomerGraphQl Magento_Elasticsearch Magento_Elasticsearch6 Magento_Elasticsearch7 Magento_Email Magento_EncryptionKey Magento_Fedex Magento_GiftMessage Magento_GiftMessageGraphQl Magento_GoogleAdwords Magento_GoogleAnalytics Magento_GoogleGtag Magento_Ui Magento_GoogleShoppingAds Magento_BundleGraphQl Magento_PageCache Magento_GroupedProduct Magento_GroupedImportExport Magento_GroupedCatalogInventory Magento_GroupedProductGraphQl Magento_DownloadableImportExport Magento_Captcha Magento_InstantPurchase Magento_CatalogAnalytics Magento_Inventory Magento_InventoryAdminUi Magento_InventoryAdvancedCheckout Magento_InventoryApi Magento_InventoryBundleImportExport Magento_InventoryBundleProduct Magento_InventoryBundleProductAdminUi Magento_InventoryBundleProductIndexer Magento_InventoryCatalog Magento_InventorySales Magento_InventoryCatalogAdminUi Magento_InventoryCatalogApi Magento_InventoryCatalogFrontendUi Magento_InventoryCatalogSearch Magento_InventoryCatalogSearchBundleProduct Magento_InventoryCatalogSearchConfigurableProduct Magento_ConfigurableProduct Magento_ConfigurableProductGraphQl Magento_InventoryConfigurableProduct Magento_InventoryConfigurableProductIndexer Magento_InventoryConfiguration Magento_InventoryConfigurationApi Magento_InventoryDistanceBasedSourceSelection Magento_InventoryDistanceBasedSourceSelectionAdminUi Magento_InventoryDistanceBasedSourceSelectionApi Magento_InventoryElasticsearch Magento_InventoryExportStockApi Magento_InventoryIndexer Magento_InventorySalesApi Magento_InventoryGroupedProduct Magento_InventoryGroupedProductAdminUi Magento_InventoryGroupedProductIndexer Magento_InventoryImportExport Magento_InventoryInStorePickupApi Magento_InventoryInStorePickupAdminUi Magento_InventorySourceSelectionApi Magento_InventoryInStorePickup Magento_InventoryInStorePickupGraphQl Magento_Shipping Magento_InventoryInStorePickupShippingApi Magento_InventoryInStorePickupQuoteGraphQl Magento_InventoryInStorePickupSales Magento_InventoryInStorePickupSalesApi Magento_InventoryInStorePickupQuote Magento_InventoryInStorePickupShipping Magento_InventoryInStorePickupShippingAdminUi Magento_Multishipping Magento_Webapi Magento_InventoryCache Magento_InventoryLowQuantityNotification Magento_Reports Magento_InventoryLowQuantityNotificationApi Magento_InventoryMultiDimensionalIndexerApi Magento_InventoryProductAlert Magento_InventoryQuoteGraphQl Magento_InventoryRequisitionList Magento_InventoryReservations Magento_InventoryReservationCli Magento_InventoryReservationsApi Magento_InventoryExportStock Magento_InventorySalesAdminUi Magento_CatalogInventoryGraphQl Magento_InventorySalesFrontendUi Magento_InventorySetupFixtureGenerator Magento_InventoryShipping Magento_InventoryShippingAdminUi Magento_InventorySourceDeductionApi Magento_InventorySourceSelection Magento_InventoryInStorePickupFrontend Magento_InventorySwatchesFrontendUi Magento_InventoryVisualMerchandiser Magento_InventoryWishlist Magento_JwtFrameworkAdapter Magento_JwtUserToken Magento_LayeredNavigation Magento_LoginAsCustomer Magento_LoginAsCustomerAdminUi Magento_LoginAsCustomerApi Magento_LoginAsCustomerAssistance Magento_LoginAsCustomerFrontendUi Magento_LoginAsCustomerGraphQl Magento_LoginAsCustomerLog Magento_LoginAsCustomerPageCache Magento_LoginAsCustomerQuote Magento_LoginAsCustomerSales Magento_Marketplace Magento_MediaContent Magento_MediaContentApi Magento_MediaContentCatalog Magento_MediaContentCms Magento_MediaContentSynchronization Magento_MediaContentSynchronizationApi Magento_MediaContentSynchronizationCatalog Magento_MediaContentSynchronizationCms Magento_AdobeStockAsset Magento_MediaGalleryApi Magento_MediaGalleryCatalog Magento_MediaGalleryCatalogIntegration Magento_MediaGalleryCatalogUi Magento_MediaGalleryCmsUi Magento_MediaGalleryIntegration Magento_MediaGalleryMetadata Magento_MediaGalleryMetadataApi Magento_MediaGalleryRenditions Magento_MediaGalleryRenditionsApi Magento_MediaGallerySynchronization Magento_MediaGallerySynchronizationApi Magento_MediaGallerySynchronizationMetadata Magento_AdobeStockImageAdminUi Magento_MediaGalleryUiApi Magento_CatalogWidget Magento_MessageQueue Magento_ConfigurableImportExport Magento_MsrpConfigurableProduct Magento_MsrpGroupedProduct Magento_InventoryInStorePickupMultishipping Magento_MysqlMq Magento_NewRelicReporting Magento_Newsletter Magento_NewsletterGraphQl Magento_OfflinePayments Magento_SalesRule Magento_Sitemap Magento_PageBuilder Magento_PageBuilderAnalytics Magento_GraphQlCache Magento_CardinalCommerce Magento_PaymentGraphQl Magento_Vault Magento_Paypal Magento_PaypalGraphQl Magento_Persistent Magento_ProductAlert Magento_ProductVideo Magento_CheckoutAgreements Magento_QuoteAnalytics Magento_QuoteBundleOptions Magento_QuoteConfigurableOptions Magento_QuoteDownloadableLinks Magento_InventoryConfigurableProductAdminUi Magento_ReCaptchaAdminUi Magento_ReCaptchaCheckout Magento_ReCaptchaCheckoutSalesRule Magento_ReCaptchaContact Magento_ReCaptchaCustomer Magento_ReCaptchaFrontendUi Magento_ReCaptchaMigration Magento_ReCaptchaNewsletter Magento_ReCaptchaPaypal Magento_ReCaptchaReview Magento_ReCaptchaSendFriend Magento_ReCaptchaStorePickup Magento_ReCaptchaUi Magento_ReCaptchaUser Magento_ReCaptchaValidation Magento_ReCaptchaValidationApi Magento_ReCaptchaVersion2Checkbox Magento_ReCaptchaVersion2Invisible Magento_ReCaptchaVersion3Invisible Magento_ReCaptchaWebapiApi Magento_ReCaptchaWebapiGraphQl Magento_ReCaptchaWebapiRest Magento_ReCaptchaWebapiUi Magento_RelatedProductGraphQl Magento_ReleaseNotification Magento_RemoteStorage Magento_InventoryLowQuantityNotificationAdminUi Magento_RequireJs Magento_Review Magento_ReviewAnalytics Magento_ReviewGraphQl Magento_AwsS3 Magento_Rss Magento_PageBuilderAdminAnalytics Magento_CatalogRuleConfigurable Magento_SalesAnalytics Magento_SalesGraphQl Magento_SalesInventory Magento_OfflineShipping Magento_ConfigurableProductSales Magento_UrlRewrite Magento_UrlRewriteGraphQl Magento_CustomerAnalytics Magento_Securitytxt Magento_SendFriend Magento_SendFriendGraphQl Magento_InventoryInStorePickupSalesAdminUi Magento_AwsS3PageBuilder Magento_InventoryGraphQl Magento_CatalogCmsGraphQl Magento_Swagger Magento_SwaggerWebapi Magento_SwaggerWebapiAsync Magento_Swatches Magento_SwatchesGraphQl Magento_SwatchesLayeredNavigation Magento_Tax Magento_TaxGraphQl Magento_TaxImportExport Magento_AsynchronousOperations Magento_ThemeGraphQl Magento_Translation Magento_GoogleOptimizer Magento_Ups Magento_SampleData Magento_CatalogUrlRewriteGraphQl Magento_AdminAdobeIms Magento_Usps Magento_InventoryConfigurableProductFrontendUi Magento_PaypalCaptcha Magento_VaultGraphQl Magento_Version Magento_InventoryInStorePickupWebapiExtension Magento_WebapiAsync Magento_WebapiSecurity Magento_Weee Magento_WeeeGraphQl Magento_CurrencySymbol Magento_Wishlist Magento_WishlistAnalytics Magento_WishlistGraphQl

List of disabled modules: Magento_TwoFactorAuth Aitoc_Core Aitoc_OptionsManagement Amasty_Base Amasty_Mage245Fix Amasty_Oaction Amasty_Ogrid Amasty_OrderAttributesSubscriptionPackage Amasty_Orderattr Betagento_Developer Geissweb_Euvat Hyva_Theme Hyva_Email Hyva_GraphqlTokens Hyva_GraphqlViewModel Hyva_CompatModuleFallback Mirasvit_Core Magefan_Community Hyva_ThemeFallback MageWorx_Info MageWorx_OrdersBase MageWorx_OrderEditor MageWorx_OrdersGrid Magefan_AdminUserGuide Magefan_Blog Magefan_BlogGraphQl Hyva_MagefanBlog Magefan_GoogleTagManager Magefan_GoogleTagManagerPlus Magefan_WysiwygAdvanced Mageplaza_Core Mageplaza_DeliveryTime Mageplaza_GeoIP Mageplaza_Osc Mageplaza_PdfInvoice Mirasvit_Search Mirasvit_Misspell Mirasvit_Report Mirasvit_SearchAutocomplete Hyva_MirasvitSearchAutocomplete Mirasvit_SearchElastic Mirasvit_SearchGraphQl Mirasvit_SearchLanding Mirasvit_SearchMysql Mirasvit_SearchReport Mirasvit_SearchSphinx Mirasvit_SearchUltimate PayPal_Braintree PayPal_BraintreeGraphQl Temando_ShippingRemover Wemessage_AntiSpam Wemessage_CopernicaWebMarketing Wemessage_GeneralImport Wemessage_ValidateCheckoutFields

engcom-Bravo commented 1 year ago

Hi @Naberdz,

Thanks for your update.

Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots.

Steps to reproduce

We are getting mails successfully.

Screenshot 2023-05-30 at 12 32 00 PM Screenshot 2023-05-30 at 12 32 35 PM

Kindly recheck the issue on Magento 2.4-develop instance and check if any 3rd party extensions / modules enabled is causing this issue.

it is recommended to verify the issue on Magento 2.4-develop instance as it is an upcoming 2.4.x release and have latest code base.

Thanks.

Naberdz commented 1 year ago

i see now what is wrong.. it seem we use old templates there in new ones the variables are different: {{var order_data.customer_name}}

although when we useInsert variable in old template it gives back same old variables. which do not work.

Any advice on how to fix it ?

hostep commented 1 year ago

The following documentation might be helpful in your case: https://developer.adobe.com/commerce/frontend-core/guide/templates/email-migration/

engcom-Bravo commented 1 year ago

@hostep Thanks for your contribution & collaboration over here.

@Naberdz Please refer this document https://developer.adobe.com/commerce/frontend-core/guide/templates/email-migration/ and please let us know if you are still facing any issue.

Thanks.

engcom-Bravo commented 1 year ago

Hi @Naberdz,

We have noticed that this issue has not been updated since long time.Hence we assume that this issue is fixed now, so we are closing it. Please raise a fresh ticket or reopen this ticket if you need more assistance on this.

Thanks.