Developer forum

Forum » Templates » Is there an easy way to test/view/build order email templates?

Is there an easy way to test/view/build order email templates?

Martin Nielsen
Reply

Hey peeps,

I'm wondering if there's an easy way to test/view/build an Order receipt email template?

My current workflow is to move my template from CartV2/Mail to CartV2/Step and then set the mail template as the template for one of my steps in the cart. Now i can see my template where my Cart is suppose to be.
Once done I move the template back to the Mail folder and undo my cart settings.

This is not an optimal flow, so I'm wondering what you guys are doing? Is there a querystring parameter that makes this easier?

BR Martin


Replies

 
Nicolai Pedersen
Reply

Hi Martin

>> I'm wondering what you guys are doing?

We also do that sometimes :-).

I am affraid that we do not have a better approach than what you do - but it would be a great idea to add a mode for that - should be relatively simple to give you a receipt rendering mode in the cart that can be used for testing. Added a feature request, TFS#39782.

BR Nicolai

 
Martin Nielsen
Reply

Glad to hear I'm doing it right way already :D

A few things I'd like to see in a possible receipt preview feature would be:

  • Ability to select an OrderID to preview
  • Fall back to test data if there's no OrderID selected
  • Be a frontend feature, or suppot F5 reload, so we can update files in disk and see the changes immediately.
  • Some way to test email break points. (nice-to-have)

BR Martin

 
Lars Larsen
Lars Larsen
Reply

Hi

Has this ever been implemented?

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Nope.

When you complete an order, you are sent to the receipt in the browser - the last step in your checkout configuration. You could use that final step to do your test of the receipt mail. You have &ordersecret=123jh12341hj123 on that page that will load the order.

So when you have the receipt page, you can do this:

  1. Change the layout of the page to be one without any layout (nolayout.cshtml). Either by using the page properties or by adding it to the URL &LayoutTemplate=nolayout.cshtml
  2. Create a nolayout context folder in your designs folder and create a paragraph template that just returns the module output. See dump
  3. On the receipt step in your cart config, choose your email template (after copying it to the \nolayout\eCom7\CartV2\Step folder)

Now you can change the template, press F5, and see how it would look.

Tricky, but a workaround. Hope you can make it work.

Capture.JPG
Votes for this answer: 1

 

You must be logged in to post in the forum