question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Email plugin EmailEventListener('order-confirmation') missed some usefull information `shippingMethod.name, productVariant.featureAsset` ..

See original GitHub issue

Describe the bug for plugin-email we want to customized EmailEventListener('order-confirmation')

but it missed as below usefull information

  1. shippingMethod.name, description cause of it has type LocaleString need to join table.
 for (const line of context.event.order.shippingLines || []) {
            let shippingMethod: ShippingMethod | undefined;
            if (!line.shippingMethod && line.shippingMethodId) {
                shippingMethod = await context.injector
                    .get(TransactionalConnection)
                    .getRepository(ShippingMethod)
                    .findOne(line.shippingMethodId);
            } else if (line.shippingMethod) {
                shippingMethod = line.shippingMethod;
            }
            if (shippingMethod) {
                shippingMethods.push(shippingMethod);
            }
        }

  1. .setTemplateVars(event => ({ order: event.order, shippingMethods: event.data.shippingMethods })) the order.line.productVariant.featuredAsset has missed also.

  2. .loadData(async ({ event, injector }) => { should be also support Language configuration for diferent language locale.

Expected behavior none

Environment (please complete the following information):

  • @vendure/core version: 1.4.4
  • Nodejs version 14.x+
  • Database (mysql/postgres etc): mysql

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
michaelbromleycommented, Mar 11, 2022

Oh yeah, the system I use to generate the changelog always says “closes #1234” even if the commit only actually includes the text “Relates to #1234”. I can see how the confusion came about.

1reaction
tianyingchuncommented, Jan 18, 2022

BTW if we configuration asset-plugin as

    AssetServerPlugin.init({
      route: 'assets',
      previewMaxHeight: 600,
      previewMaxWidth: 1200,
      assetUrlPrefix: 'https://dev.flatjs.com/assets/',

the event.order.lines[0].featuredAsset should return me full path http url but now only return me

{
  createdAt:Fri Dec 31 2021 22:41:42 GMT+0800 (China Standard Time)
  fileSize:72367
  focalPoint:null
  height:600
  id:7
  mimeType:'image/jpeg'
  name:'e110b-1__02.jpg'
// ISSUE here: should be https://dev.flatjs.com/assets/preview/1b/e110b-1__02__preview.jpg

  preview:'preview/1b/e110b-1__02__preview.jpg'
  source:'source/19/e110b-1__02.jpg'
  type:'IMAGE'
  updatedAt:Fri Dec 31 2021 22:41:42 GMT+0800 (China Standard Time)
  width:1200
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found