Skip to main content
In addition to the regular emails that any shop can send when typical situations occur, for example when a certain stock level for a product is reached, it can sometimes be useful to send automated emails to the person responsible for the shop in situations that are relevant only to individual shops. For example, it can be helpful if the shop carries products from various manufacturers and sends emails to those manufacturers whenever buyers order their products in the shop. This enables the manufacturers in question to check their stock of the affected products and to prepare the shipment so that they can dispatch as soon as the order is placed. WEBSALE V8s generally allows you to prepare custom emails for such needs, that is, emails configured by the shop operator that are sent to previously defined recipients. Delivery is triggered when a buyer visits a particular page, for example by clicking a specific product detail page, or when a particular shop state is reached, for example a logged-in customer, or is not reached, for example a search for product A without results. We pick up the latter case in the integration examples below.

How it works

The shop automatically sends an email to a statically configured recipient address when a specific page is clicked or a particular state of the shop is reached or not reached.
The email cannot be sent to dynamic recipients, for example not to a shop customer, because the recipient address has to be stored statically in the shop configuration shop.config.

Integration

Step 1: Activation

No activation on the part of WEBSALE is required for this function.

Step 2: Adjust the shop configuration

In your shop configuration shop.config, create a GenericEmails section if it does not yet exist, along with a +Entry subsection. The +Entry subsections can be repeated up to 20 times for different emails. Configure the following parameters:
Reference: GenericEmails section

Step 3: Adjust the shop templates

Now adjust the desired shop templates in order to control the sending of the email. To do this, use the tag WS-SendGenericEmail(). In the argument of the tag, enter the string that you specified in step 2 as the value of the parameter ID. Example 1, search result page. The email is sent when the buyer has performed a search and has reached the search result page.
The content of the mail can be: “A customer has visited the shop’s search page.” Example 2, search result page without hits. The email is sent when the buyer has performed a search and has reached the search result page, but the search yielded no results. This is the combination of reaching the page and a particular state.
The content of the mail can be: “A customer has visited the shop’s search page, but no hits were found for their search.” Example 3, two mails for two states of the same page. Mail 1 with the ID SuccessSearch is sent when the buyer has found something, mail 2 with the ID EmptySearch when the search was unsuccessful. This is the combination of reaching the page and different states. The prerequisite is that two sections with the corresponding IDs have been created in the shop configuration shop.config.
The content of mail 1 with the ID SuccessSearch can be: “A customer has visited the shop’s search page, and hits were found for their search.” The content of mail 2 with the ID EmptySearch can be: “A customer has visited the shop’s search page, but their search returned no hits.” Example 4, empty category. On the product overview page (ws_category.htm), the email is sent when the category contains no products.
The content of the mail can be: “The category with the name ~DC-FPCatName~ and the category index ~DC-FPCatIndex~ is empty; it does not contain any products.” Reference: WS-SendGenericEmail()

Step 4: Create the email template

Create a template and save it under the same name that is specified in the GenericEmails section as the value of the parameter Template, in your template directory, for example benutzer/templates/translation. The content of the template depends on how the delivery is being controlled. Once you have completed all steps, the function is fully integrated and can be tested and put into use.