This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'automatewoo/workflow/mailer', 'my_add_attachment_to_workflow_emails', 10, 2 ); | |
/** | |
* @param Mailer $mailer | |
* @param Workflow_Email $workflow_email | |
* @return Mailer | |
*/ | |
function my_add_attachment_to_workflow_emails( $mailer, $workflow_email ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_checkout_order_processed', 'my_woocommerce_copy_billing_email_to_user_profile', 10, 3 ); | |
/** | |
* Copy the order billing address to user profile when profile email is blank. | |
* | |
* Requires WooCommerce 3.0 | |
* | |
* @param $order_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_email_styles', 'my_filter_woocommerce_email_styles' ); | |
/** | |
* Filter email styles for WooCommerce and AutomateWoo. | |
* | |
* @param string $css | |
* | |
* @return string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* AutomateWoo action function to extend a subscription by 3 months. | |
* | |
* A note will be added to the subscription. | |
* | |
* Ensures that the dates near the end of the month are logically handled and do not shift to the start of the following month. | |
* | |
* Custom action function docs: https://automatewoo.com/docs/actions/custom-functions/ | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add product images to the WooCommerce order table used in HTML emails. | |
*/ | |
add_filter( 'woocommerce_email_order_items_args', function( $args ) { | |
$args['show_image'] = true; | |
$args['image_size'] = array( 100, 100 ); | |
return $args; | |
}, 10, 1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
// Register AutomateWoo triggers. | |
add_filter( 'automatewoo/triggers', function ( $triggers ) { | |
// Include the file containing the trigger class | |
require_once 'my-custom-order-paid-trigger.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Prevent direct access | |
} | |
/** | |
* This is an example trigger that is triggered via a WordPress action and includes a user data item. | |
* Trigger with: do_action('my_custom_action', $user_id ); | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'automatewoo/guest_capture_fields', 'my_guest_capture_fields' ); | |
/** | |
* @param array $selectors | |
*/ | |
function my_guest_capture_fields( $selectors ) { | |
$selectors[] = '#example-id-selector'; | |
$selectors[] = '.example-class-selector'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'automatewoo_custom_validate_workflow', 'my_custom_workflow_validation' ); | |
/** | |
* @param bool $valid | |
* @param AW_Model_Workflow $workflow | |
* | |
* @return bool | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach( $users as $user_id ) | |
{ | |
// fetch the existing key | |
// please note that the key should NOT include the referral prefix | |
// so if your prefix is 'REF' then the final coupon here will be 'REF1234' | |
$key = '1234' | |
$object = new AW_Model_Referral_Advocate_Key(); |
NewerOlder