![]() ![]() Under Structure->Blocks enable the Execute PHP block provided by Devel and put it somewhere visible (I just stuck it in the Content block region). Let's not worry about all of that for now, and use Devel and Maillog instead to make our lives easier. You'd also have to get mail set up as well as some kind of sandbox payment system. It is a total drag to have to add a product to the cart, checkout, and check your email to see if the changes you have made are doing what you want. To make customization of this message easier to troubleshoot, this is where we will use the Devel along with Maillog modules. Troubleshoot using Devel and Maillog so you don't have to have emails or payments set up In this last action you can set who the message is sent to, but if you're going to use the Maillog module like I am, you don't need to worry about setting up the recipient's email address. I'm not going to go through the details of how this works, but the basics are that when a checkout is completed, Commerce Message creates a new message type, the Commerce Order:order confirmation, which is then sent via Message notify (the last action). Let's check out the Rule that comes pre-configured as part of Commerce Message with the Message Type we were just looking at - this is Commerce order message: order notification e-mail. How are these messages sent? Head over to Rules (Configuration->Workflow->Rules) to check it out. Open up the tokens for Message->Order and you will see a veritable plethora of tokens. There is also the option to insert tokens into these fields. You will see there is a Message Text area, where you can modify the subject and body of a notification. Edit this message to get an idea of what is going on here. After enabling Commerce Message if you navigate to Structure -> Message Types you will see the messages that come out-of-the-box thanks to Commerce Message.įor this example we are going to look at the last message, Commerce Order: order confirmation. ![]() Enable Commerce Message and see what's going on with this moduleįor the purposes of this tutorial I will be using a vanilla Drupal Commerce site created by Commerce Kickstart (1.x-1.42). EntityReference - provides a field type that can reference arbitrary entitiesġ.Message Notify comes with plugins for email and SMS and may be extended to other transport mechanisms as required. Message Notify - provides a method for sending a message via a notifier plugin. Message - enables logging and displaying system events in a number of different use cases.If you use drush, drush dl commerce_message and drush en commerce_message will download and install this module and all of its dependencies (listed below). ![]()
0 Comments
Leave a Reply. |