Note: This is a Developer level doc. If you are unfamiliar with code/templates and resolving potential conflicts, select a WooExpert or DeveloperĀ for assistance. We are unable to provide support for customizations under ourĀ Support Policy.
Custom variables are possible using Follow-up Emails.
There is also no need to edit the core Follow-up files. In your theme’s functions.php
file or a custom plugin file, you can directly use the fue_before_variable_replacements
line to register your own variable then the function would look like this:
Here is an example of a custom variable to present the license key to users of the Software Add-on plugin: As an example, you can use the $queue_item->order_id
to pull the corresponding license key row from the woocommerce_software_licences
table like so: $licenses = $wpdb->get_results( $wpdb->prepare("SELECT * FROM {$wpdb->prefix}woocommerce_software_licences WHERE order_id = %d", $queue_item->order_id) );
Then loop through the $licenses
array if rows were found and compare and check that the $license->software_product_id
is correct:
Please use these as an example – itsĀ actual functionality is not guaranteed.