A common desire it to easily send invoices to customers when their orders reach the Sales status. This can be invoked manually or automatically when the status is changed.

This How-To covers how to set up Control to automatically send invoices to all new orders in Sales. For information on easily sending manual batches of invoices for orders recently made sales, see how-to_email_invoices_on_orders_in_sale_manually.

The basic approach used is:

  • Create an Macro to send the email that is automatically triggered when an Order is made into a sale.
  • This macro uses the Order contact's email.
  • This macro (as set up) has the email come from the person who changes the status to sale.

Create Macro

Create a Macro Using this query that Emails an Invoice

  1. Click on “Marketing Home” on the main Toolbar.
  2. Click on “Macro Setup”. This will open the Macro Setup Window.
  3. Click on “Order Macros” in the left panel.
  4. Click on “New Macro” at the top of the left panel.
  5. Enter “Auto Email Invoice” as the Macro Name on the Description Tab.
  6. Click on the Trigger Tab.
  7. We want to run this automatically, so click on “Run this macro automatically”.
  8. At least for testing, we want to run this macro on the machine you are using. Uncheck the box “Run on the server in the background”. If you later want to change this, make sure the default email options are setup properly (since the SSLIP won't have a user logged in to use their email options).
  9. Choose an “Order change event” as the triggering event.
  10. Choose an “Order Status Changed To:” from the drop-down as the change event.
  11. Choose “Sale” from the Status drop-down.
  12. If you want to be able to run this macro manually on an order from within Explorer, check the “Allow this macro to appear in the menu and be manually run for an individual order” check-box.
  13. Click on the Actions Tab
  14. The macro tab automatically starts with two pop-up message prompts. Leave the message prompts in initially, though experience tells us you may find them annoying after a while in which case edit this macro delete them at that time.
  15. Click in the “Message Text” box under the “Prompt to Begin” action tab. Type a message such as:

This macro will automatically email invoices for orders that were marked as Sale since the last time it was run.

  1. Check the box “Allow user to cancel macro execution with this message” so they user will have an OK & Cancel buttons and not just an OK button.
  2. Click on the Notify of Completion macro action tab. Type a message such as:

Done!

  1. Add an action to send the email. In the center panel is a list of macro actions. Click on “Report Macro (Crystal)” and click the “Add” button above it. This will add a new action on the right. Note: Even though we want to send an email, what we are sending is the report so we will use a Report Macro in this case.
  2. First, let's move this action before the completion message. Click the “Move Up” button in the middle column once to move this action up in the sequence. You will notice that the order of the tabs has now changed.
  3. Fill in these fields in the Report Macro action sub-tabs:
    • General Sub-Tab Options
    • Menu Item Name –> Invoice (required field, but any name will do)
    • Print Option –> select Quick Email. (necessary so it just auto-sends the invoice without prompting or previewing first)
    • File Location –> Choose System Report and select the standard invoice template you use from the drop-down (Order_Invoice01 for example), or if you use a Custom Invoice choose Custom Report and select the invoice you use from the browse dialog.
    • Options Sub-Tab Options
    • Click on the “Show Detail” button under Email
      • Click in the To: box
      • Click on the “Merge Fields” button and choose Contact | Email Address. You will notice that Control inserted the code in the To: field. This will be replaced with the email address of the order's contact.
      • Click in the Subject Line and enter a subject. You can use merge fields in this as well (for example “Invoice - ”)
    • Click in the Message box and enter a meaningful message. Again, you can use mail-merge fields by clicking on the “Merge Fields” button above. For a larger editing area, click on the “Show Expanded” button. Close the expanded message area by clicking on the “X” at the top right of that pop-up.
    • Set the other invoice options corresponding to your preferences.
  4. Save the Macro by clicking “Save” on the action toolbar.

Run Macro

The macro is setup to automatically run when the order is changed to Sale.

Contributor: Cyrious Software

Revision Date: 4/4/2011

Version: Control 4.0 and higher

You could leave a comment if you were logged in.